c - 如何防止客户端使用低于 v1.2 的 TLS 进行连接?

标签 c ssl openssl deprecated

ctx = SSL_CTX_new(TLSv1_2_server_method());

我收到一条警告,告诉我 TLSv1_2_server_method 已弃用,我应该使用通用的 TLS_server_method 并让客户端和服务器协商他们想要使用的内容。我不希望这样,因为我同时编写了服务器端和客户端,并且我想使用早期版本的错误(将来会出现)来过滤攻击。我知道我只是偏执狂,我现在可以忽略弃用警告,但我想使用我最好的选择,“暂时”对我来说还不够。那么是否有可能以某种方式强制 OpenSSL 不允许 < v1.2 TLS 客户端连接,或者它的开发人员只是做出了错误的决定并将其完全取消? (Debian 9.3, libssl-dev 1.1.0f-3+deb9u1)

最佳答案

您应该只阅读 doc因为它回答了这个问题

If you want to limit the supported protocols for the version flexible methods you can use SSL_CTX_set_min_proto_version, SSL_set_min_proto_version, SSL_CTX_set_max_proto_version and SSL_set_max_proto_version functions.

关于c - 如何防止客户端使用低于 v1.2 的 TLS 进行连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48384029/

相关文章:

c++ - 将图像加载到现有的 Mat 中

c++ - ISO C++ 禁止在 Arduino c 串行通信中比较指针和整数 [-fpermissive] 错误

C 将 char append 到 char*

python - Google Cloud Functions 中的 gaierror : [Errno -2] Name or service not known with imaplib. IMAP4_SSL

ssl - 在 Curl 中出现错误 - 无法使用已知的 CA 证书对对等证书进行身份验证

c - 使用指针访问数组和通过指针访问非数组变量之间有什么区别

ssl - WSO2 API Manager 1.8 背后的 HAProxy 问题

C 使用 openssl 执行 HTTPS 请求

Ruby 企业版 + OpenSSL -> "certificate verify failed"

xcode - 架构i386和armv7的OpenSSL Mach-O链接器错误