From feef2b4fb35b200bfe363f23de79c36ed65cd3f8 Mon Sep 17 00:00:00 2001 From: Muzaffar Auhammud Date: Wed, 11 Jul 2018 15:39:23 +0400 Subject: [PATCH] Make conditional compilation for SSLv2 future proof and backwards compatible with OpenSSL <= 1.1.0 --- src/httperf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/httperf.c b/src/httperf.c index afc39fe..4745d1e 100755 --- a/src/httperf.c +++ b/src/httperf.c @@ -1030,8 +1030,11 @@ main(int argc, char **argv) case 2: #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) ssl_ctx = SSL_CTX_new (TLS_client_method ()); - SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2); -break; +#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) + SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3); break; +#else + SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2); break; +#endif #else ssl_ctx = SSL_CTX_new (SSLv2_client_method ()); break; #endif