'WebSocket from HTTPS website to different port, self-signed certificate

I am facing issues when trying to connect from a browser via WebSocket to a server. Website is hosted on a default port (80, 443, configurable - this is s selfhosted intranet application for multiple customers). We use self signed certificates and it needs to be running with self signed cert (if possible) All works well on without SSL HTTP website (port 80), WS websocket (custom port let's say 8090)

When SSL is turned on, hence web running on HTTPS (port 443) and WebSocket on WSS:// (same port 8090). The connection is not opened. I am using rxjs WebSocketSubject to create the connection in the browser.

I am also making sure that the SSL cert is bound to both ports (443, 8090) URL ACL is set (netsh http add sslcert ipport....)

Any idea what the problem is? Is it because self-signed/insecure certificates are not accepted for websocket connection? Is the problem with SSL the different port between the website and webSocket?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source