Skip to content

Commit

Permalink
SSL: disabled shutdown after connection errors.
Browse files Browse the repository at this point in the history
This fixes "SSL_shutdown() failed (SSL: ... bad write retry)" errors
as observed on the second SSL_shutdown() call after SSL shutdown fixes in
09fb2135a589 (1.19.2), notably when sending fails in ngx_http_test_expect(),
similarly to ticket #1194.

Note that there are some places where c->error is misused to prevent
further output, such as ngx_http_v2_finalize_connection() if there
are pending streams, or in filter finalization.  These places seem
to be extreme enough to don't care about missing shutdown though.
For example, filter finalization currently prevents keepalive from
being used.
  • Loading branch information
mdounin committed Sep 16, 2020
1 parent a1864c2 commit f6c28f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/event/ngx_event_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2805,7 +2805,7 @@ ngx_ssl_shutdown(ngx_connection_t *c)
return NGX_OK;
}

if (c->timedout) {
if (c->timedout || c->error) {
mode = SSL_RECEIVED_SHUTDOWN|SSL_SENT_SHUTDOWN;
SSL_set_quiet_shutdown(c->ssl->connection, 1);

Expand Down

0 comments on commit f6c28f9

Please sign in to comment.