diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 1285abcbd..cc29b493f 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -2019,8 +2019,10 @@ reset: #if !defined(_WIN32) if( received_sigterm ) { - mbedtls_printf( " interrupted by SIGTERM\n" ); - ret = 0; + mbedtls_printf( " interrupted by SIGTERM (not in net_accept())\n" ); + if( ret == MBEDTLS_ERR_NET_INVALID_CONTEXT ) + ret = 0; + goto exit; } #endif @@ -2056,8 +2058,10 @@ reset: #if !defined(_WIN32) if( received_sigterm ) { - mbedtls_printf( " interrupted by signal\n" ); - ret = 0; + mbedtls_printf( " interrupted by SIGTERM (in net_accept())\n" ); + if( ret == MBEDTLS_ERR_NET_ACCEPT_FAILED ) + ret = 0; + goto exit; } #endif