The Fix
pip install urllib3==1.25
Based on closed urllib3/urllib3 issue #1224 · 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%.
@@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
+import mock
+import pytest
+from six import b
Frame 31: 571 bytes on wire (4568 bits), 571 bytes captured (4568 bits) on interface 0
Ethernet II, Src: BizlinkK_XX:XX:XX (9c:eb:e8:XX:XX:XX), Dst: JuniperN_XX:XX:XX (08:81:f4:XX:XX:XX)
Internet Protocol Version 4, Src: 192.168.89.18, Dst: 8.8.8.8
Transmission Control Protocol, Src Port: 1156, Dst Port: 443, Seq: 1, Ack: 1, Len: 517
Secure Sockets Layer
TLSv1.2 Record Layer: Handshake Protocol: Client Hello
Content Type: Handshake (22)
Version: TLS 1.0 (0x0301)
Length: 512
Handshake Protocol: Client Hello
Handshake Type: Client Hello (1)
Length: 508
Version: TLS 1.2 (0x0303)
Random
Session ID Length: 0
Cipher Suites Length: 148
Cipher Suites (74 suites)
Compression Methods Length: 1
Compression Methods (1 method)
Extensions Length: 319
Extension: server_name
Type: server_name (0x0000)
Length: 12
Server Name Indication extension
Server Name list length: 10
Server Name Type: host_name (0)
Server Name length: 7
Server Name: 8.8.8.8
Extension: ec_point_formats
Extension: elliptic_curves
Extension: SessionTicket TLS
Extension: signature_algorithms
Extension: Heartbeat
Extension: Padding
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\nWhen NOT to use: This fix should not be used if the server requires SNI for IP addresses.\n\n
Why This Fix Works in Production
- Trigger: TLSv1.2 Record Layer: Handshake Protocol: Client Hello
- Mechanism: The SSL client hello incorrectly includes an IP address in the server_name extension, violating the SNI specification
- Why the fix works: Prevents the use of SNI when connecting to an IP address, addressing a known bug in Python's SSL module. (first fixed release: 1.25).
- 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
- The SSL client hello incorrectly includes an IP address in the server_name extension, violating the SNI specification
- Production symptom (often without a traceback): TLSv1.2 Record Layer: Handshake Protocol: Client Hello
Proof / Evidence
- GitHub issue: #1224
- Fix PR: https://github.com/urllib3/urllib3/pull/1350
- First fixed release: 1.25
- 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.46
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“We're hitting this in pywinrm/Ansible as well if SNI is enabled”
“This is a known bug in Python's ssl module. I'll fix it for 3.7 as soon as I can drop support for OpenSSL < 1.0.2.…”
“@nitzmahone In #1287 you wrote that SNI IP address is causing connection abort with Windows' http.sys. I didn't know that the issue can cause connection…”
“@tiran done: https://bugs.python.org/issue32185 - I see it's already been default-assigned to you :D”
Failure Signature (Search String)
- TLSv1.2 Record Layer: Handshake Protocol: Client Hello
- Content Type: Handshake (22)
Copy-friendly signature
Failure Signature
-----------------
TLSv1.2 Record Layer: Handshake Protocol: Client Hello
Content Type: Handshake (22)
Error Message
Signature-only (no traceback captured)
Error Message
-------------
TLSv1.2 Record Layer: Handshake Protocol: Client Hello
Content Type: Handshake (22)
Minimal Reproduction
Frame 31: 571 bytes on wire (4568 bits), 571 bytes captured (4568 bits) on interface 0
Ethernet II, Src: BizlinkK_XX:XX:XX (9c:eb:e8:XX:XX:XX), Dst: JuniperN_XX:XX:XX (08:81:f4:XX:XX:XX)
Internet Protocol Version 4, Src: 192.168.89.18, Dst: 8.8.8.8
Transmission Control Protocol, Src Port: 1156, Dst Port: 443, Seq: 1, Ack: 1, Len: 517
Secure Sockets Layer
TLSv1.2 Record Layer: Handshake Protocol: Client Hello
Content Type: Handshake (22)
Version: TLS 1.0 (0x0301)
Length: 512
Handshake Protocol: Client Hello
Handshake Type: Client Hello (1)
Length: 508
Version: TLS 1.2 (0x0303)
Random
Session ID Length: 0
Cipher Suites Length: 148
Cipher Suites (74 suites)
Compression Methods Length: 1
Compression Methods (1 method)
Extensions Length: 319
Extension: server_name
Type: server_name (0x0000)
Length: 12
Server Name Indication extension
Server Name list length: 10
Server Name Type: host_name (0)
Server Name length: 7
Server Name: 8.8.8.8
Extension: ec_point_formats
Extension: elliptic_curves
Extension: SessionTicket TLS
Extension: signature_algorithms
Extension: Heartbeat
Extension: Padding
What Broke
Clients experience SSL handshake failures when connecting to servers using IP addresses.
Why It Broke
The SSL client hello incorrectly includes an IP address in the server_name extension, violating the SNI specification
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install urllib3==1.25
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/1350
First fixed release: 1.25
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the server requires SNI for IP 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 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.