summaryrefslogtreecommitdiff
path: root/src/tls.c
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2022-07-05 08:41:17 +0300
committerGitHub <noreply@github.com>2022-07-05 08:41:17 +0300
commit45ae6053329efce72ba91c1550e1395d0209e850 (patch)
treef6f2ea9dd2fac710b5afea4947df61f11ad8f44e /src/tls.c
parent9bcdd1537ed6404d4f9def35439af0589f1adf72 (diff)
downloadredis-45ae6053329efce72ba91c1550e1395d0209e850.tar.gz
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.
Diffstat (limited to 'src/tls.c')
-rw-r--r--src/tls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tls.c b/src/tls.c
index e7787e63a..e8d8a4f64 100644
--- a/src/tls.c
+++ b/src/tls.c
@@ -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;
}