TLS: Notify clients on connection shutdown. (#10931)

Use SSL_shutdown(), in a best-effort manner, when closing a TLS
connection. This change better supports OpenSSL 3.x clients that will
not silently ignore the socket-level EOF.
This commit is contained in:
Yossi Gottlieb 2022-07-05 08:41:17 +03:00 committed by GitHub
parent 9bcdd1537e
commit 45ae605332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -722,6 +722,8 @@ static void connTLSClose(connection *conn_) {
tls_connection *conn = (tls_connection *) conn_;
if (conn->ssl) {
if (conn->c.state == CONN_STATE_CONNECTED)
SSL_shutdown(conn->ssl);
SSL_free(conn->ssl);
conn->ssl = NULL;
}