Use the new API for SSLv3 protocol selection in OpenSSL >= 1.1.0

This commit is contained in:
Muzaffar Auhammud 2018-07-11 15:40:37 +04:00
parent feef2b4fb3
commit f2cd35e9be

View File

@ -1045,8 +1045,9 @@ main(int argc, char **argv)
case 3: case 3:
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) #if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
ssl_ctx = SSL_CTX_new (TLS_client_method ()); ssl_ctx = SSL_CTX_new (TLS_client_method ());
SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2); SSL_CTX_set_min_proto_version(ssl_ctx, SSL3_VERSION);
break; SSL_CTX_set_max_proto_version(ssl_ctx, SSL3_VERSION);
break;
#else #else
ssl_ctx = SSL_CTX_new (SSLv3_client_method ()); break; ssl_ctx = SSL_CTX_new (SSLv3_client_method ()); break;
#endif #endif