Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Websockets not working in Chrome (wss): “handshake was canceled”

I am currently developing a Websocket application on Docker Cloud. When redeploying my application and now I am always getting this error message:

WebSocket connection failed: WebSocket opening handshake was canceled

When looking into the data frame i see a single frame with this data:

(Opcode -1)

When researching the issue, it seems that is related to SSL / Certificates etc. Some solutions include adding self signed certificates. The confusing thing is that the same certificates seem to work for https but not for wss:

HTTPS works fine

Also while testing with other browsers, I see that Safari is working fine. So I am sure that the server is actually running with the correct certificate on the correct port. Only chrome seems to have issues with it.

I know some solutions on stack overflow sugesst to add the certificate manually, but since it works on Safari and it is not a self signed certificate, I would assume it should just work.

like image 355
m0c Avatar asked Oct 31 '16 15:10

m0c


1 Answers

Checking the site against SSLabs shows that the server does not provide all needed parts of the certificate chain but misses a chain certificate:

This server's certificate chain is incomplete. Grade capped to B.
...
Chain issues Incomplete
...
2 Extra download - Let's Encrypt Authority X3

Once you resolved this issue by properly configuring the server it should work in all browsers. Currently it might work with some browsers only, i.e. if the browser has cached the missing chain certificate from visits to other sites (like Firefox does) or if it works around badly configured servers by downloading missing chain certificates (Chrome).

like image 104
Steffen Ullrich Avatar answered Nov 10 '22 21:11

Steffen Ullrich