nginx 1.31.7: new SSL_read() failed (104) lines after upgrade
Since nginx 1.31.7, a client resetting a TLS connection is logged as SSL_read() failed (104) at info level. Tested against 1.31.6 with three close methods.
[info] 28#28: *1 SSL_read() failed (104: Connection reset by peer) while keepalive, client: 203.0.113.7, server: 0.0.0.0:8443If this line started showing up after an upgrade to nginx 1.31.7, nothing broke: the logging changed. Up to 1.31.6 the same event was written as closed keepalive connection (104: Connection reset by peer). Both are [info] messages, so with error_log at its default level (error) neither version prints them.
The 1.31.7 changelog entry (2026-10-14):
*) Bugfix: closing an SSL connection without close_notify was treated as a clean shutdown, including the case when the connection was reset; now "SSL_read() failed" errors appear in logs in this case.[1] Check the version. Only 1.31.x (mainline) is affected. The stable 1.30.6 released the same day does not list this entry, and in the test below it kept the old wording.
$ nginx -vnginx/1.31.7 or later is affected.
[2] Check the log level. You only see this line if some error_log is set to info or debug.
$ sudo nginx -T 2>/dev/null | grep -n 'error_log'A line like error_log /var/log/nginx/error.log info; puts you in scope. With no level given, the default is error and the line is never written.
[3] See which disconnects produce it. A TLS-enabled nginx container got one request from a Python client; after the response the client closed the connection in one of three ways, 10 times per version (a fresh container per method, error_log stderr info;).
| How the client closed | 1.31.6 | 1.31.7 |
|---|---|---|
| Sent close_notify, then closed | closed keepalive connection 10/10 | closed keepalive connection 10/10 |
| FIN only, no close_notify | closed keepalive connection 10/10 | closed keepalive connection 10/10 |
| RST (SO_LINGER 0) | closed keepalive connection (104: Connection reset by peer) 10/10 | SSL_read() failed (104: Connection reset by peer) while keepalive 10/10 |
All three, error_log at default error | 0 lines | 0 lines |
1.30.6 was tested with the RST case only and matched 1.31.6, 10/10. Output from 1.31.6 for the RST case:
2026/10/27 03:38:50 [info] 28#28: *1 client 203.0.113.7 closed keepalive connection (104: Connection reset by peer)2026/10/27 03:38:50 [info] 28#28: *2 client 203.0.113.7 closed keepalive connection (104: Connection reset by peer)The same reset on 1.31.7:
2026/10/27 03:39:17 [info] 28#28: *1 SSL_read() failed (104: Connection reset by peer) while keepalive, client: 203.0.113.7, server: 0.0.0.0:84432026/10/27 03:39:17 [info] 28#28: *2 SSL_read() failed (104: Connection reset by peer) while keepalive, client: 203.0.113.7, server: 0.0.0.0:8443The line count did not grow in this test: one line per connection either way, only the wording changed. A FIN without close_notify on an idle keepalive connection was logged identically by both versions. The changelog talks about any close without close_notify, so other states (for example, while a request is being read) may behave differently.
[4] Confirm the new lines come from this change. while keepalive with error 104 means the client dropped the connection after receiving the full response. Closed browser tabs, mobile network handovers and idle-connection cleanup on a load balancer in front commonly end with a reset.
$ grep -c 'SSL_read() failed (104: Connection reset by peer) while keepalive' /var/log/nginx/error.logIf the context is while reading client request headers or while sending to client instead, the client may not have received a response; check the status code in the access log at the same timestamp.
[5] Raise the level to cut the noise. If info was only set for a past investigation, go back to notice or the default.
error_log /var/log/nginx/error.log notice;$ sudo nginx -t && sudo systemctl reload nginxIf you need info for other client-side errors, keep it and count this message separately in your log pipeline. To undo, set the level back to info and reload.
[6] Check the other SSL logging change in the same release. 1.31.7 also fixed [crit] SSL_write() failed messages that could appear after a read error. [crit] shows at the default level, so fewer crit lines after the upgrade may come from that fix (not reproduced here). 1.31.7 also carries security fixes, so do not downgrade to silence logs; one of them is covered in CVE-2026-97629 session ticket check.
Analyze your Nginx log in the browser ↗ — nothing is uploaded.
Check it with the Certificate (PEM · X.509) decoder tool ↗ — calculated in your browser.