Add ssl_close_notify() to servers that missed it
diff --git a/programs/ssl/ssl_pthread_server.c b/programs/ssl/ssl_pthread_server.c
index 7e1b52e..efb360c 100644
--- a/programs/ssl/ssl_pthread_server.c
+++ b/programs/ssl/ssl_pthread_server.c
@@ -270,6 +270,21 @@
printf( " [ #%d ] %d bytes written\n=====\n%s\n=====\n",
thread_id, len, (char *) buf );
+ printf( " [ #%d ] . Closing the connection...", thread_id );
+
+ while( ( ret = ssl_close_notify( &ssl ) ) < 0 )
+ {
+ if( ret != POLARSSL_ERR_NET_WANT_READ &&
+ ret != POLARSSL_ERR_NET_WANT_WRITE )
+ {
+ printf( " [ #%d ] failed: ssl_close_notify returned -0x%04x\n",
+ thread_id, ret );
+ goto thread_exit;
+ }
+ }
+
+ printf( " ok\n" );
+
ret = 0;
thread_exit: