Enabling SSL causes connection to close randomly #2133
Unanswered
ethan-tonic
asked this question in
Potential Issue
Replies: 2 comments 1 reply
-
Did you find a solution? I’m facing the same rare issue with my FastAPI behind Cloudflare and a Windows client |
Beta Was this translation helpful? Give feedback.
1 reply
-
seems to be this issue with the asyncio module using a different event loop its not used to https://stackoverflow.com/questions/62412754/python-asyncio-errors-oserror-winerror-6-the-handle-is-invalid-and-runtim |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was setting up uvicorn with fastapi and enabled SSL. After enabling SSL, I noticed every now and then when I send a request, I will get the following error
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
. It seems to be a Windows specific error, but I couldn't find any solutions to it online.How to reproduce
This only occurs on Windows
To generate the certificate and key. I did the following command
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 10000 -nodes
After doing all the above steps, I just would randomly request the api test endpoint and while it works most of the time, every now and then it will fail with the following error.
If it helps, I am on version 3.11.6 of Python and on Windows 11 for my OS. My uvicorn version is 0.23.2.
Beta Was this translation helpful? Give feedback.
All reactions