Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions modules/ssl/ssl_engine_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ static void ssl_filter_io_shutdown(ssl_filter_ctx_t *filter_ctx,
SSL *ssl = filter_ctx->pssl;
const char *type = "";
SSLConnRec *sslconn = myConnConfig(c);
int quiet_shutdown;
int shutdown_type;
int loglevel = APLOG_DEBUG;
const char *logno;
Expand Down Expand Up @@ -1076,6 +1077,7 @@ static void ssl_filter_io_shutdown(ssl_filter_ctx_t *filter_ctx,
* to force the type of handshake via SetEnvIf directive
*/
if (abortive) {
quiet_shutdown = 1;
shutdown_type = SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN;
type = "abortive";
logno = APLOGNO(01998);
Expand All @@ -1085,14 +1087,16 @@ static void ssl_filter_io_shutdown(ssl_filter_ctx_t *filter_ctx,
case SSL_SHUTDOWN_TYPE_UNCLEAN:
/* perform no close notify handshake at all
(violates the SSL/TLS standard!) */
quiet_shutdown = 1;
shutdown_type = SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN;
type = "unclean";
logno = APLOGNO(01999);
break;
case SSL_SHUTDOWN_TYPE_ACCURATE:
/* send close notify and wait for clients close notify
(standard compliant, but usually causes connection hangs) */
shutdown_type = 0;
quiet_shutdown = 0;
shutdown_type = SSL_get_shutdown(ssl);
type = "accurate";
logno = APLOGNO(02000);
break;
Expand All @@ -1103,12 +1107,16 @@ static void ssl_filter_io_shutdown(ssl_filter_ctx_t *filter_ctx,
*/
/* send close notify, but don't wait for clients close notify
(standard compliant and safe, so it's the DEFAULT!) */
shutdown_type = SSL_RECEIVED_SHUTDOWN;
quiet_shutdown = 0;
shutdown_type = SSL_get_shutdown(ssl) | SSL_RECEIVED_SHUTDOWN;
type = "standard";
logno = APLOGNO(02001);
break;
}

if (quiet_shutdown) {
SSL_set_quiet_shutdown(ssl, 1);
}
SSL_set_shutdown(ssl, shutdown_type);
modssl_smart_shutdown(ssl);

Expand Down