The Fix
Upgrade to version 0.11.4 or later.
Based on closed Kludex/uvicorn issue #352 · 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%.
@@ -0,0 +1,78 @@
@@ -0,0 +1,78 @@
+import pytest
+import tempfile
+
async def app(scope, receive, send):
assert scope['type'] == 'http'
await send({
'type': 'http.response.start',
'status': 200,
'headers': [
[b'content-type', b'text/plain'],
],
})
await send({
'type': 'http.response.body',
'body': b'Hello, world!',
})
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\nUpgrade to version 0.11.4 or later.\nWhen NOT to use: This fix should not be applied if the application does not use SSL or does not require reloading.\n\n
Why This Fix Works in Production
- Trigger: load_entry_point('uvicorn==0.7.0', 'console_scripts', 'uvicorn')()
- Mechanism: The SSLContext object was created before forking, causing a TypeError during process start
- Why the fix works: Resolves the issue by delaying the loading of the SSL context until after the forking occurs, preventing the TypeError related to SSLContext objects. (first fixed release: 0.11.4).
- 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
- Shows up under Python 3.7 in real deployments (not just unit tests).
- The SSLContext object was created before forking, causing a TypeError during process start
- Surfaces as: INFO: Uvicorn running on https://127.0.0.1:8000 (Press CTRL+C to quit)
Proof / Evidence
- GitHub issue: #352
- Fix PR: https://github.com/kludex/uvicorn/pull/362
- First fixed release: 0.11.4
- 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.41
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“I have the same problem using self-signed certificates in local for development. Has this problem been resolved?”
“Okay - looks like loading the SSL context ought to move out of Config.__init__ and into Config.load()”
Failure Signature (Search String)
- load_entry_point('uvicorn==0.7.0', 'console_scripts', 'uvicorn')()
Error Message
Stack trace
Error Message
-------------
INFO: Uvicorn running on https://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [31388]
Traceback (most recent call last):
File "/tmp/tmp.zVyoktn22U/.venv/bin/uvicorn", line 11, in <module>
load_entry_point('uvicorn==0.7.0', 'console_scripts', 'uvicorn')()
File "/tmp/tmp.zVyoktn22U/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/tmp/tmp.zVyoktn22U/.venv/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/tmp/tmp.zVyoktn22U/.venv/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/tmp/tmp.zVyoktn22U/.venv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/tmp/tmp.zVyoktn22U/.venv/lib/python3.7/site-packages/uvicorn/main.py", line 256, in main
run(**kwargs)
File "/tmp/tmp.zVyoktn22U/.venv/lib/python3.7/site-packages/uvicorn/main.py", line 271, in run
supervisor.run(server.run, sockets=[socket])
File "/tmp/tmp.zVyoktn22U/.venv/lib/python3.7/site-packages/uvicorn/supervisors/statreload.py", line 34, in run
process.start()
File "/usr/lib/python3.7/multiprocessing/process.py", line 112, in start
self._popen = self._Popen(self)
File "/usr/lib/python3.7/multiprocessing/context.py", line 284
... (truncated) ...
Minimal Reproduction
async def app(scope, receive, send):
assert scope['type'] == 'http'
await send({
'type': 'http.response.start',
'status': 200,
'headers': [
[b'content-type', b'text/plain'],
],
})
await send({
'type': 'http.response.body',
'body': b'Hello, world!',
})
Environment
- Python: 3.7
What Broke
The application crashes with a TypeError when attempting to use SSL with the reload option.
Why It Broke
The SSLContext object was created before forking, causing a TypeError during process start
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.11.4 or later.
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/362
First fixed release: 0.11.4
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if the application does not use SSL or does not require reloading.
Verify Fix
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
| Version | Status |
|---|---|
| 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.