Enabling SSL causes connection to close randomly #2133
Unanswered
ethan-tonic
asked this question in
Potential Issue
Replies: 1 comment
-
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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