Jump to solution
Verify

The Fix

pip install requests==2.27.0

Based on closed psf/requests issue #4275 · 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
@@ -182,3 +182,4 @@ Patches and Suggestions - Nehal J Wani (`@nehaljwani <https://github.com/nehaljwani>`_) - Demetrios Bairaktaris (`@DemetriosBairaktaris <https://github.com/demetriosbairaktaris>`_) +- Darren Dormer (`@ddormer <https://github.com/ddormer>`_) diff --git a/HISTORY.rst b/HISTORY.rst index b099ecdb1b..db1d1f7043 100644
repro.py
{ "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.10" }, "platform": { "release": "15.6.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020cf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false }
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 requests==2.27.0\nWhen NOT to use: This fix is not applicable if the application requires credentials in the URL.\n\n

Why This Fix Works in Production

  • Trigger: "pyOpenSSL": {
  • Mechanism: Proxy bypass logic is called before stripping credentials from the URL
  • Why the fix works: Fixes an issue where DNS resolution included authentication credentials in proxy bypass settings on macOS. (first fixed release: 2.27.0).
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

  • Proxy bypass logic is called before stripping credentials from the URL
  • Production symptom (often without a traceback): "pyOpenSSL": {

Proof / Evidence

  • GitHub issue: #4275
  • Fix PR: https://github.com/psf/requests/pull/4427
  • First fixed release: 2.27.0
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-07
  • Confidence: 0.85
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.57

Discussion

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

“So this seems to be an issue with macOS specifically, and in particular how it handles proxy bypass. We should probably strip the auth from…”
@Lukasa · 2017-09-05 · source

Failure Signature (Search String)

  • "pyOpenSSL": {
  • "openssl_version": "",
Copy-friendly signature
signature.txt
Failure Signature ----------------- "pyOpenSSL": { "openssl_version": "",

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- "pyOpenSSL": { "openssl_version": "",

Minimal Reproduction

repro.py
{ "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.10" }, "platform": { "release": "15.6.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020cf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false }

What Broke

DNS resolution attempts are made for invalid hostnames with credentials.

Why It Broke

Proxy bypass logic is called before stripping credentials from the URL

Fix Options (Details)

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

pip install requests==2.27.0

When NOT to use: This fix is not applicable if the application requires credentials in the URL.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/psf/requests/pull/4427

First fixed release: 2.27.0

Last verified: 2026-02-07. 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 the application requires credentials in the URL.

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 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
2.27.0 Fixed

Related Issues

No related fixes found.

Sources

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