Websockets在Chrome(wss)中不起作用:“握手被取消” [英] Websockets not working in Chrome (wss): “handshake was canceled”

查看:2758
本文介绍了Websockets在Chrome(wss)中不起作用:“握手被取消”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在Docker Cloud上开发一个Websocket应用程序。当重新部署我的应用程序,现在我总是收到此错误信息:




WebSocket连接失败:WebSocket的开放握手被取消


查看数据框时,我看到一个包含此数据的单帧:


(Opcode -1)

在研究这个问题时,它似乎与SSL /证书等有关。解决方案包括添加自签名证书。令人困惑的是,相同的证书似乎适用于https,但不适用于wss:





在使用其他浏览器进行测试时,我发现Safari运行良好。所以我确信服务器实际上在正确的端口上运行正确的证书。



我知道一些堆栈溢出sugesst的解决方案可以手动添加证书,但由于它在Safari上工作,并且它不是一个自我签署的证书,我会认为它应该只是工作。

解决方案

检查网站 SSLabs 显示服务器不提供该证书链中的所有需要​​的部分,但错过了链证书:


此服务器的证书链不完整。成绩上限为B.

...

连锁问题不完整

...

2额外下载 - 让我们加密权限X3

一旦通过正确配置服务器解决了这个问题,它应该可以在所有浏览器中使用。目前,它可能只适用于某些浏览器,例如,如果浏览器缓存了访问其他网站(比如Firefox)时丢失的链式证书,或者它通过下载缺失的链式证书(Chrome)来处理配置错误的服务器。


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:

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.

解决方案

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).

这篇关于Websockets在Chrome(wss)中不起作用:“握手被取消”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆