From f376683f61c347d95294291d35f6c8afd79b36b5 Mon Sep 17 00:00:00 2001 From: Muzaffar Auhammud Date: Wed, 11 Jul 2018 15:46:17 +0400 Subject: [PATCH] Implement specific support for TLSv1.2 --- src/httperf.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/httperf.c b/src/httperf.c index 16013b7..eda1b09 100755 --- a/src/httperf.c +++ b/src/httperf.c @@ -1076,6 +1076,18 @@ main(int argc, char **argv) SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_2); break; #endif + /* 6/TLSv1.2 */ + case 6: +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) + ssl_ctx = SSL_CTX_new (TLS_client_method ()); + SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_2_VERSION); + SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_2_VERSION); + break; +#else + ssl_ctx = SSL_CTX_new (TLSv1_client_method ()); break; + SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1); break; +#endif + } if (!ssl_ctx) {