WSS connection server 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:// 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.



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


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.



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

2. Visit your websocket server domain name: (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” (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:

Reproduced in:

Read More: