Skip to content

Commit 8bd5734

Browse files
andypostac000
authored andcommitted
Treat a “broken pipe” on SSL_shutdown() as a normal close
Starting with OpenSSL 3.4 errno is flowed up from tls_retry_write_records() which upon EPIPE results in the following log message 2025/04/23 17:12:47 [alert] 14322#14324 *16 SSL_shutdown(25) failed (32: Broken pipe) (32: [null]) (OpenSSL: error:80000020:system library::Broken pipe:tls_retry_write_records failure) Which is harmless except it trips up the test/test_tls.py::test_tls_certificate_change test due it to looking for "alert" log messages and failing if any are found. Now, I think the tests are wrong to do this (they also don't seem to be closing the TLS connection properly). But getting EPIPE when we're shutting down the connection is likely harmless so treat it the same as a clean shutdown which also gets rid of this log message. Link: <https://github.com/openssl/openssl/commit/933f57dfe21657f7aba8f13e0cdb3b02dd64fcc3.patch> Closes: #1600 [ Commit message - Andrew ] Signed-off-by: Andrew Clayton <[email protected]>
1 parent e182d24 commit 8bd5734

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/nxt_openssl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,8 @@ nxt_openssl_conn_test_error(nxt_task_t *task, nxt_conn_t *c, int ret,
15861586

15871587
nxt_debug(task, "ERR_peek_error(): %l", lib_err);
15881588

1589-
if (sys_err != 0 || lib_err != 0) {
1589+
/* Treat a broken pipe on shutdown as a normal close */
1590+
if (sys_err != NXT_EPIPE && (sys_err != 0 || lib_err != 0)) {
15901591
c->socket.error = sys_err;
15911592
return NXT_ERROR;
15921593
}

0 commit comments

Comments
 (0)