From f74cfe4743832f2b09084697d57f364958b97183 Mon Sep 17 00:00:00 2001 From: Bernard Spil Date: Fri, 18 Dec 2015 14:03:19 +0100 Subject: [PATCH] Reroll No-SSLv3 patch/Add No-SSLv2 patch --- src/httperf.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/httperf.c b/src/httperf.c index 60d609e..2b42c96 100755 --- a/src/httperf.c +++ b/src/httperf.c @@ -664,10 +664,14 @@ main(int argc, char **argv) { if (strcasecmp (optarg, "auto") == 0) param.ssl_protocol = 0; +#ifndef OPENSSL_NO_SSL2 else if (strcasecmp (optarg, "SSLv2") == 0) param.ssl_protocol = 2; +#endif +#ifndef OPENSSL_NO_SSL3 else if (strcasecmp (optarg, "SSLv3") == 0) param.ssl_protocol = 3; +#endif else if (strcasecmp (optarg, "TLSv1") == 0) param.ssl_protocol = 4; else @@ -997,10 +1001,14 @@ main(int argc, char **argv) { /* 0/auto for SSLv23 */ case 0: ssl_ctx = SSL_CTX_new (SSLv23_client_method ()); break; +#ifndef OPENSSL_NO_SSL2 /* 2/SSLv2 */ case 2: ssl_ctx = SSL_CTX_new (SSLv2_client_method ()); break; +#endif +#ifndef OPENSSL_NO_SSL3 /* 3/SSLv3 */ case 3: ssl_ctx = SSL_CTX_new (SSLv3_client_method ()); break; +#endif /* 4/TLSv1 */ case 4: ssl_ctx = SSL_CTX_new (TLSv1_client_method ()); break; } @@ -1204,8 +1212,12 @@ main(int argc, char **argv) switch (param.ssl_protocol) { case 0: printf (" --ssl-protocol=auto"); break; +#ifndef OPENSSL_NO_SSL2 case 2: printf (" --ssl-protocol=SSLv2"); break; +#endif +#ifndef OPENSSL_NO_SSL3 case 3: printf (" --ssl-protocol=SSLv3"); break; +#endif case 4: printf (" --ssl-protocol=TLSv1"); break; } #endif