Ws: WSS Error on Localhost

Created on 24 Aug 2018  路  4Comments  路  Source: websockets/ws

  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Description

Hello,

I have followed the instructions over at External HTTP/S server to connect the websocket over https but I keep getting an error saying the connection to the websocket failed ERR_SSL_PROTOCOL_ERROR.
I'm using a self-signed certificate for localhost and the server and client use the same cert and key.
Is it possible to test ws with https on localhost or ws cannot recognize self-signed certificates?

Thank You!

All 4 comments

Use the rejectUnauthorized option on the client, set it to false.

Hey @lpinca thank you for your help.
It turned out that the problem was I was setting a custom port WebSocket.Server({ server , port: 3005}).
It's strange cause with http custom ports work, anyway thanks again :smile:.

If you use the port option, a plain HTTP server is created and used internally. In your example the server option is ignored.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anonaka picture anonaka  路  5Comments

jorenvandeweyer picture jorenvandeweyer  路  4Comments

makc picture makc  路  4Comments

ImBundle picture ImBundle  路  3Comments

NodePing picture NodePing  路  5Comments