WSS connection server error

Error:

1. The error prompt for SSL certificate rejection is different between Firefox and chrome

(1) Chrome error: websocket connection failed: error in connection establishment: Net:: err_ CERT_ AUTHORITY_ INVALID

(2) an error is reported in Firefox: it is unable to create a wss://www.wss.com/ Connection to the server.

2. Although the error prompts for SSL certificate rejection are different between Firefox and chrome, the solution steps are exactly the same.

 

code:

1 var ws = new WebSocket("wss://www.wss.com");

 

Cause of the problem:

Because the certificate is self signed, the CA of the certificate must not exist in the root storage area of the operating system. Naturally, the operating system will not recognize you, and the natural browser will not recognize you, that is, the self signed certificate is not trusted.

 

Solution:

1. Open a new tab page in Firefox or chrome.

2. Visit your websocket server domain name: https://www.wss.com (change the WSS request to an HTTPS request with the same domain name and port number).

3. You will find the browser alarm: “your connection is not private connection…”.

Don’t panic, look down and click “advanced”.

5. Continue to click “continue to” www.wss.com (unsafe) “.

6. The page will prompt “400 bad request…”, don’t worry. This is due to using HTTP protocol to access WSS service. Don’t worry. You can solve the prompt error here.

 

Reprinted from: http://www.blogdaren.com/post-2456.html?from=singlemessage

Reproduced in: https://www.cnblogs.com/XuYuFan/p/10917909.html

Read More: