diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index be9d07b287..330abbe5ae 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -869,7 +869,7 @@ int main( int argc, char *argv[] ) else if( strcmp( p, "exchanges" ) == 0 ) { opt.exchanges = atoi( q ); - if( opt.exchanges < 1 ) + if( opt.exchanges < 0 ) goto usage; } else if( strcmp( p, "min_version" ) == 0 ) @@ -1740,6 +1740,9 @@ reset: } #endif /* POLARSSL_X509_CRT_PARSE_C */ + if( opt.exchanges == 0 ) + goto close_notify; + exchanges = opt.exchanges; data_exchange: /*