ELB listener configuration for WSS websocket

2.3k Views Asked by At

My Websocket WS works fine.But When I use WSS , it fails with below error.

WebSocket connection to 'wss://mywebsocket.ca/' failed: Error in connection establishment: net::ERR_INSECURE_RESPONSE It feels some SSL issue. I have my certificates configured properly and all other url through this ELB works fine. my Ws curl works good.

What could be the issue? Could it be the listerner configuraiton of ELB for HTTPS is not done properly.

I am just using some chrome extensions to connect Websocket.No code here.

1

There are 1 best solutions below

7
On BEST ANSWER

This took me a while to figure out. I hope I haven't forgotten anything in the answer below as it was a while ago I did it.

First of all you need to bypass CloudFront as it doesn't run well with websockets (unless something has changed recently). Setup an A alias Route 53 record pointing to your load balancer (i.e. websockets.domain.com).

Setup a listener for your port in your in your load balancer (i.e. 5678). Note that you should use SSL (Secure TCP) protocol. You also need a SSL certificate to your listener. Use ACM for this, it gives you the option there.

enter image description here

Remember to change your websockets connection to use this new connection as well.