The Fix
pip install urllib3==2.2.0
Based on closed urllib3/urllib3 issue #3325 · 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 @@
@@ -0,0 +1 @@
+Fixed TLS 1.3 Post Handshake Auth when the server certificate validation was disabled.
diff --git a/src/urllib3/util/ssl_.py b/src/urllib3/util/ssl_.py
index e0a7c04a3c..b14cf27b61 100644
import platform
import ssl
import urllib3
print("OS", platform.platform())
print("Python", platform.python_version())
print(ssl.OPENSSL_VERSION)
print("urllib3", urllib3.__version__)
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==2.2.0\nWhen NOT to use: Do not use this fix if server certificate validation is required.\n\n
Why This Fix Works in Production
- Trigger: TLS 1.3 Post Handshake Auth no longer working with urllib 2.1.0 when ignoring cert validation
- Mechanism: The change in the commit restricted post_handshake_auth to only when cert_reqs is CERT_REQUIRED
- Why the fix works: Fixed TLS 1.3 Post Handshake Auth when the server certificate validation was disabled. (first fixed release: 2.2.0).
- 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.7 in real deployments (not just unit tests).
- The change in the commit restricted post_handshake_auth to only when cert_reqs is CERT_REQUIRED
- Production symptom (often without a traceback): TLS 1.3 Post Handshake Auth no longer working with urllib 2.1.0 when ignoring cert validation
Proof / Evidence
- GitHub issue: #3325
- Fix PR: https://github.com/urllib3/urllib3/pull/3326
- First fixed release: 2.2.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.75
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.70
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Thank you for reporting this issue and opening a fix!”
Failure Signature (Search String)
- TLS 1.3 Post Handshake Auth no longer working with urllib 2.1.0 when ignoring cert validation
- if (cert_reqs == ssl.CERT_REQUIRED or sys.version_info >= (3, 7, 4)) and getattr(
Copy-friendly signature
Failure Signature
-----------------
TLS 1.3 Post Handshake Auth no longer working with urllib 2.1.0 when ignoring cert validation
if (cert_reqs == ssl.CERT_REQUIRED or sys.version_info >= (3, 7, 4)) and getattr(
Error Message
Signature-only (no traceback captured)
Error Message
-------------
TLS 1.3 Post Handshake Auth no longer working with urllib 2.1.0 when ignoring cert validation
if (cert_reqs == ssl.CERT_REQUIRED or sys.version_info >= (3, 7, 4)) and getattr(
Minimal Reproduction
import platform
import ssl
import urllib3
print("OS", platform.platform())
print("Python", platform.python_version())
print(ssl.OPENSSL_VERSION)
print("urllib3", urllib3.__version__)
Environment
- Python: 3.7
- urllib3: 2.1.0
What Broke
Authentication fails and the TLS socket is closed by the server due to missing client certificate.
Why It Broke
The change in the commit restricted post_handshake_auth to only when cert_reqs is CERT_REQUIRED
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install urllib3==2.2.0
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/3326
First fixed release: 2.2.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if server certificate validation is required.
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 |
|---|---|
| 2.2.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.