Answer the question
In order to leave comments, you need to log in
How to properly connect an ssl certificate, and is it possible to run the server on my PC?
How can I connect an ssl certificate to a server in python.
In this case, I tried to install a certificate on the site from which communication with the server will take place
On the server (on the PC), files were created, such as: cert.pem, chain.pem, etc.
I connect these files, Example:
if __name__ == '__main__':
if config.SSL_KEY:
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ssl_context.load_cert_chain(config.SSL_CHAIN, config.SSL_KEY)
start_server = websockets.serve(handler, config.IP, config.PORT, ssl=ssl_context)
else:
start_server = websockets.serve(handler, config.IP, config.PORT)
asndf = asyncio.get_event_loop()
asndf.run_until_complete(start_server)
asyncio.get_event_loop().run_forever()
SSL_CHAIN = "C:\\Certbot\\live\\chat-messenger-kot.herokuapp.com\\cert.pem"
SSL_KEY = "C:\\Certbot\\live\\chat-messenger-kot.herokuapp.com\\privkey.pem"
WebSocket connection to "wss://IP:PORT" failed:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question