requests.exceptions.ConnectionError: HTTPSConnectionPool(host=…, port=443): Max retries exceeded with url
requests couldn’t connect — the inner error (NewConnectionError, NameResolutionError, SSLError, ConnectTimeout) says why.
Seen on:
Python
Meaning
“Max retries exceeded” is a wrapper. Read the “Caused by” part: name resolution means DNS, Connection refused means nothing listening, SSLError means certificates, timeouts mean network/firewall.
Common causes
- DNS failure / typo in host
- Server down or port blocked
- Proxy settings
- SSL certificate problems
- Being rate-limited/blocked
⚡ Quick fix
- Read the “Caused by …” part of the message
- Test with curl from the same machine
- Set timeouts and use a Retry adapter
Detailed fix by platform
Python
requests.get(url, timeout=(3, 30))
How to diagnose
- Cause — What follows "Caused by"?
- Reachability — curl from the same host
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026