jeudi 30 avril 2020

Web socket connection does not work over SSL

I have Web Socket that works perfectly fine on localhost and production (https://www.example.com) environment.

However, when I deploy the same code to pp environment (https://pp.example.com) I get WebSocket handshake: Unexpected response code: 404

I have AWS certificate manager generated certificate for domain example.com, with additional domain name www.example.com and pp.example.com

www.example.com and pp.example.com are sitting on different server so they have different ip addresses.

When I go to www.example.com and make the following call,

let ws = new WebSocket("wss://www.example.com/ws");

It works perfectly fine.web socket is connected.

However, when I switch to pp.example.com and make the following call

let ws = new WebSocket("wss://pp.example.com/ws");

I get error from Safari, Firefox and Chrome:

WebSocket connection to 'wss://pp.example.com/ws' failed: Error during WebSocket handshake: Unexpected response code: 404

Any ideas?

The code are exactly the same.




Aucun commentaire:

Enregistrer un commentaire