Use SSL_CTX_set_min_proto_version for OpenSSL >= 1.1.0.

GitOrigin-RevId: b346e0b2dd5358d1154d537d02ddcba368b5e792
This commit is contained in:
levlam 2020-05-16 20:08:44 +03:00
parent 842e2033b7
commit 8d9a72b8d5
1 changed files with 3 additions and 0 deletions

View File

@ -236,6 +236,9 @@ class SslStreamImpl {
options |= SSL_OP_NO_SSLv3;
#endif
SSL_CTX_set_options(ssl_ctx, options);
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION);
#endif
SSL_CTX_set_mode(ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | SSL_MODE_ENABLE_PARTIAL_WRITE);
if (cert_file.empty()) {