diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index 838115039..1937eb6f4 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -574,18 +574,28 @@ int main( int argc, char *argv[] ) opt.min_version = SSL_MINOR_VERSION_1; opt.max_version = SSL_MINOR_VERSION_1; } - else if( strcmp( q, "tls1_1" ) == 0 || - strcmp( q, "dtls1" ) == 0 ) + else if( strcmp( q, "tls1_1" ) == 0 ) { opt.min_version = SSL_MINOR_VERSION_2; opt.max_version = SSL_MINOR_VERSION_2; } - else if( strcmp( q, "tls1_2" ) == 0 || - strcmp( q, "dtls1_2" ) == 0 ) + else if( strcmp( q, "tls1_2" ) == 0 ) { opt.min_version = SSL_MINOR_VERSION_3; opt.max_version = SSL_MINOR_VERSION_3; } + else if( strcmp( q, "dtls1" ) == 0 ) + { + opt.min_version = SSL_MINOR_VERSION_2; + opt.max_version = SSL_MINOR_VERSION_2; + opt.transport = SSL_TRANSPORT_DATAGRAM; + } + else if( strcmp( q, "dtls1_2" ) == 0 ) + { + opt.min_version = SSL_MINOR_VERSION_3; + opt.max_version = SSL_MINOR_VERSION_3; + opt.transport = SSL_TRANSPORT_DATAGRAM; + } else goto usage; } diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 78b5d20e9..59c949c11 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -857,18 +857,28 @@ int main( int argc, char *argv[] ) opt.min_version = SSL_MINOR_VERSION_1; opt.max_version = SSL_MINOR_VERSION_1; } - else if( strcmp( q, "tls1_1" ) == 0 || - strcmp( q, "dtls1" ) == 0 ) + else if( strcmp( q, "tls1_1" ) == 0 ) { opt.min_version = SSL_MINOR_VERSION_2; opt.max_version = SSL_MINOR_VERSION_2; } - else if( strcmp( q, "tls1_2" ) == 0 || - strcmp( q, "dtls1_2" ) == 0 ) + else if( strcmp( q, "tls1_2" ) == 0 ) { opt.min_version = SSL_MINOR_VERSION_3; opt.max_version = SSL_MINOR_VERSION_3; } + else if( strcmp( q, "dtls1" ) == 0 ) + { + opt.min_version = SSL_MINOR_VERSION_2; + opt.max_version = SSL_MINOR_VERSION_2; + opt.transport = SSL_TRANSPORT_DATAGRAM; + } + else if( strcmp( q, "dtls1_2" ) == 0 ) + { + opt.min_version = SSL_MINOR_VERSION_3; + opt.max_version = SSL_MINOR_VERSION_3; + opt.transport = SSL_TRANSPORT_DATAGRAM; + } else goto usage; }