Add ssl_close_notify() to servers that missed it
diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c
index 4bb457c..4e199c3 100644
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -1261,6 +1261,20 @@
printf( " ok\n" );
}
+ printf( " . Closing the connection..." );
+
+ while( ( ret = ssl_close_notify( &ssl ) ) < 0 )
+ {
+ if( ret != POLARSSL_ERR_NET_WANT_READ &&
+ ret != POLARSSL_ERR_NET_WANT_WRITE )
+ {
+ printf( " failed\n ! ssl_close_notify returned %d\n\n", ret );
+ goto reset;
+ }
+ }
+
+ printf( " ok\n" );
+
ret = 0;
goto reset;