websocket wss协议问题

qizexi · · 7499 次点击
楼主好,我也遇到一样的问题,我是买的sectigo的证书,在浏览器中访问https 证书是没问题。我的代码如下:http.ListenAndServe(":9999", nil)这个加nginx是能正常wss访问的。我想省掉nginx 就改了代码 改成了err := http.ListenAndServeTLS(":443", "./t.crt", "./t.key", nil) if err != nil { log.Fatal("ListenAndServeTLS: ", err) } 也启动成功没报错,但是浏览器wss访问就是没数据。
#2
更多评论
已经解决,就是h5的 websocket 的 wss 协议,必须是有经过受信任的 ca 鉴证才行。这个是在网上看到的回复信息:Is your Ratchet installation configured to support secure connections (wss:)? Are your keypair and certificate correctly installed? Note also that self-signed certificates will not be accepted by a WebSocket client; it must be signed by a trusted CA
#1