Skip to content

Commit

Permalink
TLS: Notify clients on connection shutdown. (redis#10931)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yossigo authored and enjoy-binbin committed Jul 31, 2023
1 parent 01f0783 commit 95c4a58
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 95c4a58

Please sign in to comment.