Jump to solution
Verify

The Fix

I want to see if the workaround actually resolves the issue for confirmed cases ( this will mean I didnt screw something up while trying to do it).

Based on closed psf/requests issue #2022

Jump to Verify
repro.py
>> import requests >> requests.get('https://docs.apitools.com/2014/04/24/a-small-router-for-openresty.html') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 383, in request resp = self.send(prep, **send_kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 486, in send r = adapter.send(request, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/adapters.py", line 385, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Apply the official fix\nI want to see if the workaround actually resolves the issue for confirmed cases ( this will mean I didnt screw something up while trying to do it).\nWhen NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.\n\nOption C — Workaround\nfor broken servers.`\nWhen NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.\n\n

Why This Fix Works in Production

  • Trigger: >> import requests
  • Mechanism: I want to see if the workaround actually resolves the issue for confirmed cases ( this will mean I didnt screw something up while trying to do it).

Why This Breaks in Prod

  • Dependency interaction matters here: urllib3 v1.8.
  • Shows up under Python 2.7 in real deployments (not just unit tests).
  • Surfaces as: >> import requests

Proof / Evidence

  • GitHub issue: #2022
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-04
  • Confidence: 0.00
  • Did this fix it?: No (no upstream fix linked)
  • Own content ratio: 0.23

Discussion

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

“Sadly, this is unrelated to the issue you identified, and entirely down to the crappy OpenSSL that OS X ships with by default”
@Lukasa · 2014-04-26 · source
“@jvanasco i'm still here. I was wondering, do you have a public URL i could test this with? I want to see if the workaround…”
@Lekinho · 2016-06-07 · confirmation · source
“No need to apologise, asking that question was the right thing to do: it's bizarrely specific knowledge to know that OS X has this problem.…”
@Lukasa · 2014-04-26 · source
“OK, I may have just answered my own question. What I did boils down to:”
@lsemel · 2015-09-25 · source

Failure Signature (Search String)

  • >> import requests

Error Message

Stack trace
error.txt
Error Message ------------- >> import requests >> requests.get('https://docs.apitools.com/2014/04/24/a-small-router-for-openresty.html') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 383, in request resp = self.send(prep, **send_kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 486, in send r = adapter.send(request, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/adapters.py", line 385, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
Stack trace
error.txt
Error Message ------------- >> adapter = SSLAdapter('TLSv1') >> s = requests.Session() >> s.mount('https://', adapter) >> s.get('https://docs.apitools.com/2014/04/24/a-small-router-for-openresty.html') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 395, in get return self.request('GET', url, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 383, in request resp = self.send(prep, **send_kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 486, in send r = adapter.send(request, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/adapters.py", line 385, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
Stack trace
error.txt
Error Message ------------- >> adapter = SSLAdapter('SSLv3') >> s = requests.Session() >> s.mount('https://', adapter) >> s.get('https://docs.apitools.com/2014/04/24/a-small-router-for-openresty.html') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 395, in get return self.request('GET', url, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 383, in request resp = self.send(prep, **send_kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 486, in send r = adapter.send(request, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/adapters.py", line 385, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure

Minimal Reproduction

repro.py
>> import requests >> requests.get('https://docs.apitools.com/2014/04/24/a-small-router-for-openresty.html') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 383, in request resp = self.send(prep, **send_kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/sessions.py", line 486, in send r = adapter.send(request, **kwargs) File "/Users/jaddison/.virtualenvs/techtown/lib/python2.7/site-packages/requests/adapters.py", line 385, in send raise SSLError(e) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

Environment

  • Python: 2.7
  • urllib3: 1.8

Fix Options (Details)

Option A — Apply the official fix

I want to see if the workaround actually resolves the issue for confirmed cases ( this will mean I didnt screw something up while trying to do it).

When NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.

Option C — Workaround Temporary workaround

for broken servers.`

When NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.

Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.

Fix reference: https://github.com/psf/requests/issues/2022

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not use if it changes public behavior or if the failure cannot be reproduced.

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

Related Issues

No related fixes found.

Sources

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