The Fix
pip install requests==2.27.0
Based on closed psf/requests issue #5662 · 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%.
@@ -10,7 +10,7 @@ jobs:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
- os: [ubuntu-latest, macOS-latest, windows-latest]
+ os: [ubuntu-18.04, macOS-latest, windows-latest]
include:
Steps
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.
Option A — Upgrade to fixed release\npip install requests==2.27.0\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: GHA: Tests fail with ubuntu-20.04
- Mechanism: Pins the GitHub Actions to Ubuntu 18.04 to avoid test failures on Ubuntu 20.04.
- Why the fix works: Pins the GitHub Actions to Ubuntu 18.04 to avoid test failures on Ubuntu 20.04. (first fixed release: 2.27.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
- Production symptom (often without a traceback): GHA: Tests fail with ubuntu-20.04
Proof / Evidence
- GitHub issue: #5662
- Fix PR: https://github.com/psf/requests/pull/5663
- First fixed release: 2.27.0
- 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.69
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Good catch, @hugovk! It looks like our local httpbin server for tests is having trouble either with the newer version of openssl or configuration being…”
Failure Signature (Search String)
- GHA: Tests fail with ubuntu-20.04
- GitHub Actions fails when using the Ubuntu 20.04 image, and pass with 18.04.
Copy-friendly signature
Failure Signature
-----------------
GHA: Tests fail with ubuntu-20.04
GitHub Actions fails when using the Ubuntu 20.04 image, and pass with 18.04.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
GHA: Tests fail with ubuntu-20.04
GitHub Actions fails when using the Ubuntu 20.04 image, and pass with 18.04.
Minimal Reproduction
- Steps
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install requests==2.27.0
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/5663
First fixed release: 2.27.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use if it changes public behavior or if the failure cannot be reproduced.
Verify Fix
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.
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
| Version | Status |
|---|---|
| 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.