Good afternoon everyone!
Currently I am getting the following error when attempting to connect to my web app that runs under HTTPS:
WebSocket connection to 'wss://localhost:8000/ws' failed: Error in connection establishment: net::ERR_INSECURE_RESPONSE. I am using the same private key and self-signed certificate for the websocket as I am for the httpd server (Apache).
I have configured my
httpd.conf file per the following instructions (without optional instructions): How to set up Apache web server on Cent OS. Note that I am using Red Hat, which is very similar to Cent OS.
Here is the main part of my Twisted code that defines and connects the web resources and websocket resource (note
TLS is set to
if __name__ == '__main__': # SSL server context: load server key and certificate # We use this for both WS and Web! if TLS: contextFactory = ssl.DefaultOpenSSLContextFactory('/etc/pki/tls/private/ca.key', '/etc/pki/tls/certs/ca.crt') factory = WsProtocolFactory() factory.protocol = WsProtocol ws_resource = WebSocketResource(factory) root = Resource() root.putChild("", HttpResource()) root.putChild("login", LoginResource()) root.putChild("refresh", RefreshResource()) root.putChild(b"ws", ws_resource) site = HttpFactory(root) if TLS: reactor.listenSSL(8000, site, contextFactory) else: reactor.listenTCP(8000, site) reactor.run()
I tried using
ProxyPass in the
httpd.conf file, but does not seem to work. Here's a link to the example I tried: Websockets not working with HTTPS in an Apache Proxy .
Any help would be greatly appreciated! Thank you so much.