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
- Check server and proxy logs for timeouts or crashes at the same moment.
- 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.
- Test from another network to rule out an intercepting device.
Got a different message? Paste it into the error explainer.
Related errors
- curl: (3) URL using bad/illegal format or missing URL · curl could not parse the URL
- curl: (77) error setting certificate verify locations · curl can't read its CA certificate bundle
- Error: write EPIPE · Wrote to a connection the other side had closed
- TypeError: fetch failed · Node.js fetch failed below HTTP
- Error: listen EADDRINUSE: address already in use · Another process is already using the port
- Error: EMFILE: too many open files · The process ran out of file descriptors
- unable to get local issuer certificate · The client can't find the certificate's issuer
- unable to verify the first certificate · The intermediate certificate is missing
- certificate has expired · The server certificate has expired
- self signed certificate in certificate chain · The chain ends in an untrusted root
- wrong version number · TLS spoken to something that isn't TLS
- curl: (6) Could not resolve host · The hostname doesn't resolve