mutt_ssl_gnutls.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
# HG changeset patch # User Michael Elkins <[email protected]> # Date 1360292296 0 # Branch HEAD # Node ID b66c92518aedc8f08d86fd58aeb715462356bd98 # Parent 2a1c5d3dd72eb2f27581a385ae5309e0ab744222 only terminate the write-half of the TLS connection to avoid hanging if the remote doesn't respond. RFC5246 section 7.2.4 states that the initiator of the closure need not wait for the remote to response before closing the read-half. closes #3633 diff --git a/mutt_ssl_gnutls.c b/mutt_ssl_gnutls.c --- a/mutt_ssl_gnutls.c +++ b/mutt_ssl_gnutls.c @@ -385,7 +385,15 @@ tlssockdata *data = conn->sockdata; if (data) { - gnutls_bye (data->state, GNUTLS_SHUT_RDWR); + /* shut down only the write half to avoid hanging waiting for the remote to respond. + * + * RFC5246 7.2.1. "Closure Alerts" + * + * It is not required for the initiator of the close to wait for the + * responding close_notify alert before closing the read side of the + * connection. + */ + gnutls_bye (data->state, GNUTLS_SHUT_WR); gnutls_certificate_free_credentials (data->xcred); gnutls_deinit (data->state);
