Skip to content
MtrXTools

unexpected eof while reading

The peer closed the connection without a TLS close

Seen in OpenSSL 3, curl, Python ssl, PHP, Ruby, nginx

The TCP connection was closed without the TLS close_notify message, which OpenSSL 3 reports as an error instead of a normal end.

Common causes

  • The server, proxy or load balancer closed the socket abruptly, for example on a timeout or crash.
  • A server that never sends close_notify; OpenSSL 1.1.1 tolerated this, OpenSSL 3 does not.
  • A firewall or TLS-inspecting device cut the connection during the handshake or transfer.

How to fix it

  1. Check server and proxy logs for timeouts or crashes at the same moment.
  2. If the response was complete and the server simply skips close_notify, fix the server or set SSL_OP_IGNORE_UNEXPECTED_EOF in the client.
  3. Test from another network to rule out an intercepting device.

Got a different message? Paste it into the error explainer.

Related errors

All 34 Command line & code errors