mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
mod_ssl: Ensure that the SSL close notify alert is flushed to the client.
PR54998. Submitted By: Tim Kosse <tim.kosse filezilla-project.org>, ylavic Committed By: ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601184 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -125,6 +125,7 @@ int SSL_smart_shutdown(SSL *ssl)
|
||||
{
|
||||
int i;
|
||||
int rc;
|
||||
int flush;
|
||||
|
||||
/*
|
||||
* Repeat the calls, because SSL_shutdown internally dispatches through a
|
||||
@@ -134,8 +135,17 @@ int SSL_smart_shutdown(SSL *ssl)
|
||||
* connection and OpenSSL cannot recognize it.
|
||||
*/
|
||||
rc = 0;
|
||||
flush = !(SSL_get_shutdown(ssl) & SSL_SENT_SHUTDOWN);
|
||||
for (i = 0; i < 4 /* max 2x pending + 2x data = 4 */; i++) {
|
||||
if ((rc = SSL_shutdown(ssl)))
|
||||
rc = SSL_shutdown(ssl);
|
||||
if (rc >= 0 && flush && (SSL_get_shutdown(ssl) & SSL_SENT_SHUTDOWN)) {
|
||||
/* Once the close notity is sent through the output filters,
|
||||
* ensure it is flushed through the socket.
|
||||
*/
|
||||
BIO_flush(ssl->wbio);
|
||||
flush = 0;
|
||||
}
|
||||
if (rc != 0)
|
||||
break;
|
||||
}
|
||||
return rc;
|
||||
|
Reference in New Issue
Block a user