Reputation: 31
I am trying to make secure Websocket connection (wss) with an ip address, when I run following code:
new WebSocket("wss://x.x.x.x/socket.io/?EIO=3&transport=websocket")
It gives me following error:
WebSocket connection to 'wss://x.x.x.x/socket.io/?EIO=3&transport=websocket' failed: Error in connection establishment: net::ERR_INSECURE_RESPONSE
Upvotes: 2
Views: 3553
Reputation: 123541
My guess is that you don't have a trusted certificate at the server end. This certificate must be either trusted already by the browser for the IP you access (i.e. the exact IP address, not the domain resolving to this IP) or it must by signed by a CA trusted in the browser and must have a subjectAltName of type IPAddress with this specific IP address. Note that a CN (common name) with the IP address will not be enough.
Upvotes: 2