The Fix
pip install urllib3==1.25.2
Based on closed urllib3/urllib3 issue #1582 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -1,6 +1,12 @@
=======
+dev (master)
+------------
+
Traceback (most recent call last):
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 344, in _make_request
self._validate_conn(conn)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 843, in _validate_conn
conn.connect()
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connection.py", line 350, in connect
ssl_context=context)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/util/ssl_.py", line 369, in ssl_wrap_socket
return context.wrap_socket(sock)
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 814, in __init__
self.do_handshake()
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:777)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 641, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/util/retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='v2.sg.media-imdb.com', port=443): Max retries exceeded with url: /suggests/s/Southpaw.json (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:777)'),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/h3llrais3r/Auto-Subliminal/autosubliminal/indexer.py", line 351, in get_imdb_id_and_year
api_obj = self._search(title, year)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/autosubliminal/indexer.py", line 273, in _search
search_results = ImdbFacade().search_for_title(title)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/imdbpie/facade.py", line 87, in search_for_title
for result in self._client.search_for_title(query):
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/imdbpie/imdbpie.py", line 182, in search_for_title
search_results = self._suggest_search(title)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/imdbpie/imdbpie.py", line 160, in _suggest_search
search_results = self._get(url=url, query=query_encoded)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/imdbpie/imdbpie.py", line 308, in _get
resp = self.session.get(url, headers=headers, params=params)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/
... (truncated) ...
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install urllib3==1.25.2\nWhen NOT to use: This fix should not be applied if the application requires support for IPvFuture addresses.\n\n
Why This Fix Works in Production
- Trigger: chunked=chunked)
- Mechanism: The SSL handshake failure occurs due to incorrect detection of IPvFuture addresses
- Why the fix works: Addresses an SSL handshake failure by modifying the detection of IP addresses to exclude IPvFuture addresses, resolving issue #1582. (first fixed release: 1.25.2).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Shows up under Python 3.6 in real deployments (not just unit tests).
- The SSL handshake failure occurs due to incorrect detection of IPvFuture addresses
- Surfaces as: Traceback (most recent call last):
Proof / Evidence
- GitHub issue: #1582
- Fix PR: https://github.com/urllib3/urllib3/pull/1583
- First fixed release: 1.25.2
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.32
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Are you providing a proper CA cert for that ConnectionPool? One of the changes in 1.25 is that cert_reqs defaults to CERT_REQUIRED.”
“I'm not using a CA cert”
“Thanks for investigation. Let me know if I need to test something. :wink:”
“Thanks. Latest release solved the issue. :+1:”
Failure Signature (Search String)
- chunked=chunked)
Error Message
Stack trace
Error Message
-------------
Traceback (most recent call last):
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 344, in _make_request
self._validate_conn(conn)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 843, in _validate_conn
conn.connect()
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connection.py", line 350, in connect
ssl_context=context)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/util/ssl_.py", line 369, in ssl_wrap_socket
return context.wrap_socket(sock)
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 814, in __init__
self.do_handshake()
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:777)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/a
... (truncated) ...
Minimal Reproduction
Traceback (most recent call last):
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 344, in _make_request
self._validate_conn(conn)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 843, in _validate_conn
conn.connect()
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connection.py", line 350, in connect
ssl_context=context)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/util/ssl_.py", line 369, in ssl_wrap_socket
return context.wrap_socket(sock)
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 814, in __init__
self.do_handshake()
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "/opt/python/3.6.3/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:777)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/connectionpool.py", line 641, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/urllib3/util/retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='v2.sg.media-imdb.com', port=443): Max retries exceeded with url: /suggests/s/Southpaw.json (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:777)'),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/h3llrais3r/Auto-Subliminal/autosubliminal/indexer.py", line 351, in get_imdb_id_and_year
api_obj = self._search(title, year)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/autosubliminal/indexer.py", line 273, in _search
search_results = ImdbFacade().search_for_title(title)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/imdbpie/facade.py", line 87, in search_for_title
for result in self._client.search_for_title(query):
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/imdbpie/imdbpie.py", line 182, in search_for_title
search_results = self._suggest_search(title)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/imdbpie/imdbpie.py", line 160, in _suggest_search
search_results = self._get(url=url, query=query_encoded)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/imdbpie/imdbpie.py", line 308, in _get
resp = self.session.get(url, headers=headers, params=params)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/home/travis/build/h3llrais3r/Auto-Subliminal/lib/requests/
... (truncated) ...
Environment
- Python: 3.6
What Broke
Users experience SSL handshake failures when connecting to certain hosts, leading to failed requests.
Why It Broke
The SSL handshake failure occurs due to incorrect detection of IPvFuture addresses
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install urllib3==1.25.2
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/urllib3/urllib3/pull/1583
First fixed release: 1.25.2
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if the application requires support for IPvFuture addresses.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
- Add a TLS smoke test that performs a real handshake in CI (include CA bundle validation and hostname checks).
- Alert on handshake failures by error string and endpoint to catch cert/CA changes quickly.
Version Compatibility Table
| Version | Status |
|---|---|
| 1.25.2 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.