“通用名称无效"用于 websocket 服务器的自签名证书 [英] "common name invalid" for a self-signed certificate for websocket server
问题描述
我正在尝试运行这个
我猜我需要在生成 ssl 证书期间设置正确的通用名称,我目前将其设置为 0.0.0.0:6503
.
我应该设置什么?由于这是一个websocket的地址,我不知道该写哪个部分?
将其设置为 localhost
,这是您尝试连接的同一主机.您不需要包括端口.请注意,您需要在生产中获得证书.
您可能还想检查忽略本地主机上的证书错误的非常有用的 Chrome 标志:chrome://flags/#allow-insecure-localhost
I'm trying to run this webrtc client/signaling server code, but after running the server with a new self-signed certificate I created by following the instructions of this tutorial, my chatclient.js
couldn't connect to socket server:
connection = new WebSocket('wss://localhost:6503/', 'json');
this is the error displayed by chrome's console:
(chatclient.js:106) WebSocket connection to 'wss://localhost:6503/' failed:
Error in connection establishment: net::ERR_CERT_COMMON_NAME_INVALID
I then go to https://0.0.0.0:6503/
from chrome (the server is listening on port 6503), and this is the security tab from chrome inspector:
I'm guessing I need to set the correct common name during the generation of ssl certificate, to which I current set as 0.0.0.0:6503
.
What should I set? Since this is a websocket's address and I have no idea which part to write?
Set it to localhost
which is the same host you're trying to connect to. You do not need to include the port. Note that you will need a certificate in production.
You might also want to check the highly useful Chrome flag which ignores certificate errors on localhost: chrome://flags/#allow-insecure-localhost
这篇关于“通用名称无效"用于 websocket 服务器的自签名证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!