Jump to solution
Verify

The Fix

pip install urllib3==1.25.4

Based on closed urllib3/urllib3 issue #1603 · 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%.

Jump to Verify Open PR/Commit
@@ -4,6 +4,10 @@ Changes ------------ +* Change ``HTTPSConnection`` to load system CA certificates + when ``ca_certs``, ``ca_cert_dir``, and ``ssl_context`` are + unspecified. (Pull #1608, Issue #1603)
repro.py
if self.ssl_context is None: self.ssl_context = create_urllib3_context( ssl_version=resolve_ssl_version(None), cert_reqs=resolve_cert_reqs(None), ) self.sock = ssl_wrap_socket( sock=conn, keyfile=self.key_file, certfile=self.cert_file, key_password=self.key_password, ssl_context=self.ssl_context, server_hostname=self.server_hostname )
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install urllib3==1.25.4\nWhen NOT to use: This fix is not applicable if custom CA certificates are explicitly provided.\n\n

Why This Fix Works in Production

  • Trigger: if self.ssl_context is None:
  • Mechanism: Default system certificates are not loaded due to incorrect SSL context handling in HTTPSConnection
  • Why the fix works: Load system CA certificates by default on empty HTTPSConnection to resolve SSL errors. (first fixed release: 1.25.4).
Production impact:
  • 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

  • Triggered by an upgrade/regression window: 3.4 breaks; 1.25.4 is the first fixed release.
  • Shows up under Python 3.4 in real deployments (not just unit tests).
  • Default system certificates are not loaded due to incorrect SSL context handling in HTTPSConnection
  • Production symptom (often without a traceback): if self.ssl_context is None:

Proof / Evidence

  • GitHub issue: #1603
  • Fix PR: https://github.com/urllib3/urllib3/pull/1608
  • First fixed release: 1.25.4
  • Affected versions: 3.4
  • 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.65

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“Yep, this looks incorrect. Unfortunately I can't currently think of a good way to handle this and maintain all our interfaces+contracts without calling load_default_certs() inside…”
@sethmlarson · 2019-05-08 · source
“Basically this boils down to create_urllib3_context() not knowing about ca_cert or ca_cert_dir and so it can't make the call whether to load the default system…”
@sethmlarson · 2019-05-08 · source

Failure Signature (Search String)

  • if self.ssl_context is None:
  • self.ssl_context = create_urllib3_context(
Copy-friendly signature
signature.txt
Failure Signature ----------------- if self.ssl_context is None: self.ssl_context = create_urllib3_context(

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- if self.ssl_context is None: self.ssl_context = create_urllib3_context(

Minimal Reproduction

repro.py
if self.ssl_context is None: self.ssl_context = create_urllib3_context( ssl_version=resolve_ssl_version(None), cert_reqs=resolve_cert_reqs(None), ) self.sock = ssl_wrap_socket( sock=conn, keyfile=self.key_file, certfile=self.cert_file, key_password=self.key_password, ssl_context=self.ssl_context, server_hostname=self.server_hostname )

Environment

  • Python: 3.4

What Broke

Users experience SSL certificate verification failures when making HTTPS requests.

Why It Broke

Default system certificates are not loaded due to incorrect SSL context handling in HTTPSConnection

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install urllib3==1.25.4

When NOT to use: This fix is not applicable if custom CA certificates are explicitly provided.

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/1608

First fixed release: 1.25.4

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not applicable if custom CA certificates are explicitly provided.

Verify Fix

verify
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

VersionStatus
3.4 Broken
1.25.4 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.