Fix send_close_notify usage.
diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c
index 70fffc5..5b4a6bd 100644
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -1803,8 +1803,10 @@
 close_notify:
     printf( "  . Closing the connection..." );
 
-    /* Don't check for errors, the connection might already be closed */
-    ssl_close_notify( &ssl );
+    /* No error checking, the connection might be closed already */
+    do ret = ssl_close_notify( &ssl );
+    while( ret == POLARSSL_ERR_NET_WANT_WRITE );
+    ret = 0;
 
     printf( " done\n" );
     goto reset;