Answer the question
In order to leave comments, you need to log in
How to make wss connection support?
WebSocket connection to ' wss://localhost:8000/ws ' failed:
Everything is fine as long as the project was local, after posting an error about the secure protocol. I don't understand what needs to be done to make it work?
Tried what is commented out - same error.
import os
from models.ws_handler import WsHandler
from consumer import ServerConsumer
import tornado.ioloop
import ssl
if __name__ == '__main__':
consumer = ServerConsumer()
consumer.start_start_consuming_thread()
application = tornado.web.Application(handlers=[
(r'/ws', WsHandler)
], default_host="0.0.0.0")
port = int(os.environ["PORT"])
ssl_ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_ctx.load_cert_chain(os.path.join(os.path.abspath('.'), "private", "cert.pem"),
os.path.join(os.path.abspath('.'), "private", "key.pem"))
ssl_ctx.load_verify_locations(os.path.join(os.path.abspath('.'), "private", "key.pem"))
http_server = tornado.httpserver.HTTPServer(application, ssl_options=ssl_ctx)
http_server.listen(port=port)
#application.listen(port=port)
tornado.ioloop.IOLoop.instance().start()
Answer the question
In order to leave comments, you need to log in
The domain name is not correct, not what is specified in the certificate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question