http.client.RemoteDisconnected: Remote end closed connection without response
The server closed the connection without replying
Seen in Python http.client, urllib, requests ("('Connection aborted.', RemoteDisconnected(...))")
Python sent the request but the server closed the connection before any HTTP response arrived.
Common causes
- The server or a proxy closed a keep-alive connection just as it was reused.
- The server crashed or timed out while handling the request.
- A WAF or bot protection drops requests it considers automated.
- Plain HTTP sent to a port that expects TLS.
How to fix it
- Retry idempotent requests with urllib3 Retry on a requests Session.
- Check server and proxy logs at the time of the request.
- Check the URL scheme and port match.
- If a WAF is blocking you, use an API intended for programmatic access or ask the site owner.
Got a different message? Paste it into the error explainer.
Related errors
- Max retries exceeded with url · requests gave up connecting to the URL
- javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) · Java has no TLS version it may use with this server
- [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed · Python couldn't verify the server's certificate
- certificate verify failed: Hostname mismatch, certificate is not valid for · The certificate doesn't cover this hostname
- socket.gaierror: [Errno -2] Name or service not known · Python couldn't resolve the hostname
- socket.gaierror: [Errno -3] Temporary failure in name resolution · Python couldn't reach a DNS resolver
- requests.exceptions.ConnectTimeout · Python couldn't open the connection in time
- requests.exceptions.ReadTimeout · The server took too long to respond
- ConnectionRefusedError: [Errno 111] Connection refused · Nothing is listening on that port
- PKIX path building failed · Java can't build a trusted certificate chain
- javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure · The server rejected the TLS handshake
- java.net.UnknownHostException · Java couldn't resolve the hostname