summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2023-04-01 21:47:20 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2023-04-01 21:48:28 +0100
commitf1bf269876f4e32b074d271168edc2af64e1c7a6 (patch)
tree5c27491f6b42c4daf61fb72a8fcc780ecebaa237
parent8d960c19a447e105a4375c2cbcd0c9493622b6a2 (diff)
downloadexim4-f1bf269876f4e32b074d271168edc2af64e1c7a6.tar.gz
Expansions: Fix ${readsocket } to do nicer TLS close
-rw-r--r--doc/doc-txt/ChangeLog3
-rw-r--r--src/src/lookups/readsock.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 71f71a6ca..16d2b8ef8 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -119,6 +119,9 @@ JH/25 Bug 2827: Restrict size of References: header in bounce messages to 998
a not-impossible References: in the message being bounced could still
be over-large and get stopped in the transport.
+JH/26 For a ${readsocket } in TLS mode, send a TLS Close Alert before the TCP
+ close. Previously a bare socket close was done.
+
Exim version 4.96
-----------------
diff --git a/src/src/lookups/readsock.c b/src/src/lookups/readsock.c
index a3f87108a..73cc02813 100644
--- a/src/src/lookups/readsock.c
+++ b/src/src/lookups/readsock.c
@@ -275,6 +275,10 @@ if (!lf.cache) *do_cache = 0;
out:
+#ifndef DISABLE_TLS
+if (cctx->tls_ctx) tls_close(cctx->tls_ctx, TLS_SHUTDOWN_NOWAIT);
+#endif
+
(void) close(cctx->sock);
cctx->sock = -1;
return ret;
@@ -294,7 +298,7 @@ readsock_close(void * handle)
client_conn_ctx * cctx = handle;
if (cctx->sock < 0) return;
#ifndef DISABLE_TLS
-if (cctx->tls_ctx) tls_close(cctx->tls_ctx, TRUE);
+if (cctx->tls_ctx) tls_close(cctx->tls_ctx, TLS_SHUTDOWN_NOWAIT);
#endif
close(cctx->sock);
cctx->sock = -1;