Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome wss连接失败:连接建立中出错:net::ERR\u CERT\u COMMON\u NAME\u无效_Google Chrome_Ssl_Freeswitch_Sipjs - Fatal编程技术网

Google chrome wss连接失败:连接建立中出错:net::ERR\u CERT\u COMMON\u NAME\u无效

Google chrome wss连接失败:连接建立中出错:net::ERR\u CERT\u COMMON\u NAME\u无效,google-chrome,ssl,freeswitch,sipjs,Google Chrome,Ssl,Freeswitch,Sipjs,我已经建立了一个可用的FreeSwitch box,可以使用ws-connections在桌面上进行内部调用。稍后,我将该框配置为使用SSL和Letsencrypt颁发的证书。SSL证书都通过验证,并且Chrome中的https://连接显示了良好的锁定标志 然后我将代码从ws改为wss(见下文;公共IP地址被屏蔽),但在Chrome中出现了“net::ERR\u CERT\u COMMON\u NAME\u INVALID”错误 <!DOCTYPE html> <html&g

我已经建立了一个可用的FreeSwitch box,可以使用ws-connections在桌面上进行内部调用。稍后,我将该框配置为使用SSL和Letsencrypt颁发的证书。SSL证书都通过验证,并且Chrome中的https://连接显示了良好的锁定标志

然后我将代码从ws改为wss(见下文;公共IP地址被屏蔽),但在Chrome中出现了“net::ERR\u CERT\u COMMON\u NAME\u INVALID”错误

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>sipjs-webphone</title>
    <script src="./sip-0.15.1.min.js"></script>
    <script>

    var config = {  uri: '1000@1xx.xxx.xxx.xxx', 
    transportOptions: { wsServers: ['wss://1xx.xxx.xxx.xxx:7443'] }, 
    authorizationUser: '1000', password: '1234' };

    var ua = new SIP.UA(config);

    ua.on("connected", function() {
        console.log("Connected!");
    });
    </script>
</head>
<body>
</body>
</html>

2) 在/usr/local/freeswitch/certs中创建了wss.pem(如果此目录是由“apt install freeswitch”安装的,而不是通过编译源代码安装的,则此目录不存在),但仍然没有乐趣。

您可以创建从letencrypt certificate到的符号链接 /etc/freeswitch/tls/wss.key和/etc/freeswitch/tls/wss.crt

如果存在wss.key和wss.crt,则FreeSwitch不使用wss.pem文件

如果使用默认键从源代码生成freeswitch,则将/etc/freeswitch文件夹保存到您的位置


供参考。从软件包安装的FreeSwitch使用/etc/FreeSwitch,而不是/usr/local/FreeSwitch

在URL中不使用IP地址。让我们为主机名而不是IP地址加密证书。所以总是会有不匹配,因此你会得到错误。是的,它是有效的!!!你救了我一天!!!非常感谢!
echo '' >> /usr/local/freeswitch/certs/wss.pem && cat cert.pem >> /usr/local/freeswitch/certs/wss.pem && cat privkey.pem >> /usr/local/freeswitch/certs/wss.pem && cat chain.pem >> /usr/local/freeswitch/certs/wss.pem