Jump to solution
Details

The Fix

Upgrade to version 0.11.4 or later.

Based on closed Kludex/uvicorn issue #330 · 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%.

Open PR/Commit
@@ -43,6 +43,9 @@ INTERFACES = ["auto", "asgi3", "asgi2", "wsgi"] +# Fallback to 'ssl.PROTOCOL_SSLv23' in order to support Python < 3.5.3. +SSL_PROTOCOL_VERSION = getattr(ssl, "PROTOCOL_TLS", ssl.PROTOCOL_SSLv23) +
fix.md
Option A — Upgrade to fixed release\nUpgrade to version 0.11.4 or later.\nWhen NOT to use: This fix should not be used if the application requires strict TLS protocol enforcement.\n\n

Why This Fix Works in Production

  • Trigger: AttributeError: module 'ssl' has no attribute 'PROTOCOL_TLS' on Python ,,,3.5.2 Python 3.5 ssl module has no attribute 'PROTOCOL_TLS'
  • Mechanism: Adds compatibility for Python versions less than 3.5.3 by falling back to 'ssl.PROTOCOL_SSLv23'.
  • Why the fix works: Adds compatibility for Python versions less than 3.5.3 by falling back to 'ssl.PROTOCOL_SSLv23'. (first fixed release: 0.11.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.6 breaks; 0.11.4 is the first fixed release.
  • Shows up under Python 3.5 in real deployments (not just unit tests).
  • Surfaces as: AttributeError: module 'ssl' has no attribute 'PROTOCOL_TLS' on Python ,,,3.5.2\nPython 3.5 ssl module has no attribute 'PROTOCOL_TLS'

Proof / Evidence

  • GitHub issue: #330
  • Fix PR: https://github.com/kludex/uvicorn/pull/355
  • First fixed release: 0.11.4
  • Affected versions: 3.6
  • 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).

“Believe this to now be resolved with 0.7.1”
@lovelydinosaur · 2019-05-02 · confirmation · source
“Hooray! I now have Uvicorn running on Glitch: https://glitch.com/~asgi-uvicorn”
@simonw · 2019-06-08 · source
“Okay, thanks. Will try to look into that sometime. Are you able to upgrade to 3.6+?”
@lovelydinosaur · 2019-03-22 · source
“I have not see any error message, when run docker run -it --rm python:3.5-alpine python -c "import ssl;ssl.PROTOCOL_TLS"”
@Hanaasagi · 2019-04-04 · source

Failure Signature (Search String)

  • AttributeError: module 'ssl' has no attribute 'PROTOCOL_TLS' on Python ,,,3.5.2\nPython 3.5 ssl module has no attribute 'PROTOCOL_TLS'

Error Message

Stack trace
error.txt
Error Message ------------- AttributeError: module 'ssl' has no attribute 'PROTOCOL_TLS' on Python ,,,3.5.2\nPython 3.5 ssl module has no attribute 'PROTOCOL_TLS'

Environment

  • Python: 3.5

Fix Options (Details)

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

Upgrade to version 0.11.4 or later.

When NOT to use: This fix should not be used if the application requires strict TLS protocol enforcement.

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

Fix reference: https://github.com/kludex/uvicorn/pull/355

First fixed release: 0.11.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 should not be used if the application requires strict TLS protocol enforcement.

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
3.6 Broken
0.11.4 Fixed

Related Issues

No related fixes found.

Sources

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