The Fix
pip install urllib3==1.26.7
Based on closed urllib3/urllib3 issue #2320 · PR/commit linked
Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.
@@ -448,3 +448,34 @@ To enable this simply define environment variable `SSLKEYLOGFILE`:
Then configure the key logfile in `Wireshark <https://wireshark.org>`_, see
`Wireshark TLS Decryption <https://wiki.wireshark.org/TLS#TLS_Decryption>`_ for instructions.
+
+Custom SSL Contexts
+-------------------
Option A — Upgrade to fixed release\npip install urllib3==1.26.7\nWhen NOT to use: This fix should not be used if custom SSLContext usage is not required.\n\n
Why This Fix Works in Production
- Trigger: Document how to use custom SSLContext objects
- Mechanism: The documentation did not include examples for using custom SSLContext objects
- Why the fix works: Added an example of how to use custom SSLContext objects in urllib3 documentation, addressing issue #2320. (first fixed release: 1.26.7).
Why This Breaks in Prod
- The documentation did not include examples for using custom SSLContext objects
- Production symptom (often without a traceback): Document how to use custom SSLContext objects
Proof / Evidence
- GitHub issue: #2320
- Fix PR: https://github.com/urllib3/urllib3/pull/2357
- First fixed release: 1.26.7
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.72
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Quentin highlighted to me that we don't document the ssl_context parameter or how you can configure a custom SSLContext so perhaps we can document those…”
“How would this be implemented via SSLContext? If it can be implemented this way then urllib3 can do it, otherwise it's likely not going to…”
Failure Signature (Search String)
- Document how to use custom SSLContext objects
- Provide an example of how to configure urllib3 to enable Partial Certificate chain validation.
Copy-friendly signature
Failure Signature
-----------------
Document how to use custom SSLContext objects
Provide an example of how to configure urllib3 to enable Partial Certificate chain validation.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Document how to use custom SSLContext objects
Provide an example of how to configure urllib3 to enable Partial Certificate chain validation.
What Broke
Users were unable to configure partial certificate chain validation in urllib3.
Why It Broke
The documentation did not include examples for using custom SSLContext objects
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install urllib3==1.26.7
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/2357
First fixed release: 1.26.7
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if custom SSLContext usage is not required.
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.26.7 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.