-
-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secure websocket using example code unable to handle unsecured requests #1446
Comments
New note: also: may be a wrong lead, but just was goin through code quickly |
Indeed, websockets cannot handle TLS and non-TLS connections on the same port. websockets usually runs behind a routing layer (which every cloud hosting service provides) or a reverse proxy that takes care of terminating TLS connections — and responding to non-TLS connection appropriately. What's your use case for supporting both? |
I just assumed it would be supported, I just wanted to attempt to run without a reverse proxy on the output, but should it be required to keep the same python context, I can continue with that route. Is there any possibility to run this with both tls and non tls; It seams to be a arbitrary requirement, should we not attempt to fix it for any reason? Is it intentional, or not? |
This behavior is inherited from create_server. |
Versions:
websockets 12.0
Python 3.10.13
On the examples (readthedocs, github) the server is able to connect via https; but any attempts to connect via http no longer connect, only immediate closing the server.
While testing with (not exact code from demo, but should be close enough to be the same)
No path is printed while using this, and all browsers just return
ERR_EMPTY_RESPONSE
keys generated with
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out localhost.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname" -subj '/CN=localhost'
The text was updated successfully, but these errors were encountered: