Jump to solution
Verify

The Fix

pip install urllib3==1.25

Based on closed urllib3/urllib3 issue #500 · 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
@@ -330,6 +330,8 @@ def test_enhanced_ssl_connection(self): def test_ssl_correct_system_time(self): + self._pool.cert_reqs = 'CERT_REQUIRED' + self._pool.ca_certs = DEFAULT_CA with warnings.catch_warnings(record=True) as w:
repro.py
/Users/raulcd/Projects/requests/requests/packages/urllib3/connectionpool.py(511)urlopen() 510 # Request a connection from the queue. --> 511 conn = self._get_conn(timeout=pool_timeout) 512 ipdb> self.cert_reqs 'CERT_NONE' ipdb> n ipdb> conn.cert_reqs 'CERT_REQUIRED'
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\nWhen NOT to use: This fix should not be applied if the connection pool's behavior needs to remain consistent across requests.\n\n

Why This Fix Works in Production

  • Trigger: --> 511 conn = self._get_conn(timeout=pool_timeout)
  • Mechanism: Connections retrieved from the pool retain incorrect certificate requirements based on previous requests
  • Why the fix works: Addresses the issue where connections retrieved from the pool have incorrect certificate requirements. (first fixed release: 1.25).
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

  • Connections retrieved from the pool retain incorrect certificate requirements based on previous requests
  • Production symptom (often without a traceback): --> 511 conn = self._get_conn(timeout=pool_timeout)

Proof / Evidence

  • GitHub issue: #500
  • Fix PR: https://github.com/urllib3/urllib3/pull/501
  • First fixed release: 1.25
  • 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).

“Mmm, yes, the connections in the pool should be homogenous to the pool's definition”
@shazow · 2014-11-04 · source
“One possible solution is in #501, it's the simplest but there is one specific problem with it.”
@sigmavirus24 · 2014-11-05 · source

Failure Signature (Search String)

  • --> 511 conn = self._get_conn(timeout=pool_timeout)
Copy-friendly signature
signature.txt
Failure Signature ----------------- --> 511 conn = self._get_conn(timeout=pool_timeout)

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- --> 511 conn = self._get_conn(timeout=pool_timeout)

Minimal Reproduction

repro.py
/Users/raulcd/Projects/requests/requests/packages/urllib3/connectionpool.py(511)urlopen() 510 # Request a connection from the queue. --> 511 conn = self._get_conn(timeout=pool_timeout) 512 ipdb> self.cert_reqs 'CERT_NONE' ipdb> n ipdb> conn.cert_reqs 'CERT_REQUIRED'

What Broke

Requests may fail due to incorrect SSL certificate requirements, leading to connection errors.

Why It Broke

Connections retrieved from the pool retain incorrect certificate requirements based on previous requests

Fix Options (Details)

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

pip install urllib3==1.25

When NOT to use: This fix should not be applied if the connection pool's behavior needs to remain consistent across requests.

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

First fixed release: 1.25

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 should not be applied if the connection pool's behavior needs to remain consistent across requests.

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.
  • Track RSS + object counts after deployments; alert on monotonic growth and GC pressure.
  • Add a long-running test that repeats the failing call path and asserts stable memory.

Version Compatibility Table

VersionStatus
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.