Merge pull request #61 from muzaffar1331/fix-major-bugs

Fix major bugs. Done during IETF 102 hackathon.
This commit is contained in:
Adrian Chadd 2018-07-12 11:11:00 -07:00 committed by GitHub
commit 3209c7f9b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -668,6 +668,8 @@ main(int argc, char **argv)
param.ssl_ca_path = optarg; param.ssl_ca_path = optarg;
else if (flag == &param.ssl_protocol) else if (flag == &param.ssl_protocol)
{ {
param.use_ssl = 1;
if (strcasecmp (optarg, "auto") == 0) if (strcasecmp (optarg, "auto") == 0)
param.ssl_protocol = 0; param.ssl_protocol = 0;
#ifndef OPENSSL_NO_SSL2 #ifndef OPENSSL_NO_SSL2
@ -1060,7 +1062,7 @@ main(int argc, char **argv)
SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_VERSION); SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_VERSION);
break; break;
#else #else
ssl_ctx = SSL_CTX_new (TLSv1_client_method ()); break; ssl_ctx = SSL_CTX_new (TLSv1_client_method ());
SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2); break; SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2); break;
#endif #endif
@ -1072,7 +1074,7 @@ main(int argc, char **argv)
SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_1_VERSION); SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_1_VERSION);
break; break;
#else #else
ssl_ctx = SSL_CTX_new (TLSv1_client_method ()); break; ssl_ctx = SSL_CTX_new (TLSv1_client_method ());
SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_2); break; 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 #endif
@ -1084,12 +1086,13 @@ main(int argc, char **argv)
SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_2_VERSION); SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_2_VERSION);
break; break;
#else #else
ssl_ctx = SSL_CTX_new (TLSv1_client_method ()); break; ssl_ctx = SSL_CTX_new (TLSv1_client_method ());
SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1); 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 #endif
#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) #if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
/* 7/TLSv1.3 */ /* 7/TLSv1.3 */
case 7:
ssl_ctx = SSL_CTX_new (TLS_client_method ()); ssl_ctx = SSL_CTX_new (TLS_client_method ());
SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_3_VERSION); SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_3_VERSION);
SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_3_VERSION); SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_3_VERSION);