Fix the fatal failure caused by an SSL error

When a "Connection reset by peer" error was caused while reading through SSL, a
restoration of the session should have taken place after all the connection
related structures were resetted.  But instead a silent, unexpected and
unaccountable exit was the end result.  This was caused by the underlying
socket being closed while trying to shutdown the SSL session.
This commit is contained in:
Lefteris Chatzimparmpas 2012-02-22 18:59:28 +01:00
parent 83e406b70e
commit 8c468f585f

View File

@ -187,6 +187,8 @@ close_secure_connection(session *ssn)
{
if (ssn->sslsocket) {
SSL_set_shutdown(ssn->sslsocket, SSL_SENT_SHUTDOWN |
SSL_RECEIVED_SHUTDOWN);
SSL_shutdown(ssn->sslsocket);
SSL_free(ssn->sslsocket);
ssn->sslsocket = NULL;