Index: generic/tls.c ================================================================== --- generic/tls.c +++ generic/tls.c @@ -2822,19 +2822,10 @@ *------------------------------------------------------------------- */ void Tls_Clean(State *statePtr) { dprintf("Called"); - if (statePtr->ssl) { - /* Send close_notify message */ - dprintf("SSL_shutdown(%p)", statePtr->ssl); - /* Will return return 0 while shutdown in process, then 1 when complete */ - /* closes the write direction of the connection; the read direction is closed by the peer. */ - /* Does not affect socket */ - SSL_shutdown(statePtr->ssl); - } - /* * we're assuming here that we're single-threaded */ if (statePtr->timer != (Tcl_TimerToken) NULL) { Tcl_DeleteTimerHandler(statePtr->timer); Index: generic/tlsIO.c ================================================================== --- generic/tlsIO.c +++ generic/tlsIO.c @@ -72,12 +72,19 @@ State *statePtr = (State *) instanceData; dprintf("TlsCloseProc(%p)", (void *) statePtr); /* Flush any pending data */ + + /* Send shutdown notification. Will return 0 while in process, then 1 when complete. */ + /* Closes the write direction of the connection; the read direction is closed by the peer. */ + /* Does not affect socket state. */ + if (statePtr->ssl != NULL) { + SSL_shutdown(statePtr->ssl); + } - Tls_Clean(statePtr); + /* Tls_Free calls Tls_Clean */ Tcl_EventuallyFree((ClientData)statePtr, Tls_Free); return 0; } /*