Shubham Gupta
Shubham Gupta

Reputation: 31

Secure Websocket connection (wss) with ip address

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

Answers (1)

Steffen Ullrich
Steffen Ullrich

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

Related Questions