[英]Connection to websocket has failed due to “ERR_CERT_DATE_INVALID”
I have online website in which SSL is installed.我有安装 SSL 的在线网站。 If I enter the website, I can see a valid SSL certificate in the website.
如果我进入网站,我可以在网站中看到有效的 SSL 证书。 Currently, the certificate is valid by November.
目前,该证书的有效期为 11 月。 I have a javascript code connects to my website websocket on port 8080. By last week, this worked perfect.
我有一个 javascript 代码在端口 8080 上连接到我的网站 websocket。到上周为止,这很完美。 But suddenly, without making any changes to the website at all, everyone who enter the website gets the error:
但是突然间,根本没有对网站做任何更改,每个进入网站的人都会收到错误:
WebSocket connection to 'wss://myWebSiteXXX:8080/' failed: Error in connection establishment: net::ERR_CERT_DATE_INVALID
This is the js code that tries to connect:这是尝试连接的js代码:
const conn = new WebSocket('wss://myWebSiteXXX:8080');
Why is that?这是为什么?
https://website/
and wss://website:8080/
might be the same host but are two different server configurations - one for port 443 and one for port 8080. You've checked only the certificate for the first server ( https://
) but this is likely not the same certificate as for the seconds server ( wss://
). https://website/
和wss://website:8080/
可能是同一个主机,但有两种不同的服务器配置 - 一个用于端口 443,一个用于端口 8080。您只检查了第一台服务器的证书 ( https://
),但这可能与秒服务器( wss://
)的证书不同。 Thus, check your Websocket server configuration and make sure that it provides a valid certificate too.因此,请检查您的 Websocket 服务器配置并确保它也提供了有效的证书。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.