我正在尝试运行 Kurento WebRTC 的 Javascript 录制示例,如下所示:
http://doc-kurento.readthedocs.org/en/stable/tutorials/js/tutorial-recorder.html
我在 Ubuntu 机器上安装了 Kurento,它运行正常。该服务也已启动。此外,我测试了基于 Java 的示例,它运行没有任何问题。
js录制示例失败,错误如下:
Mixed Content: The page at 'https://ABCDEF' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://XYZ:8433/'. This request has been blocked; this endpoint must be available over WSS
我更改了 ws_uri 变量以指向一个安全的网络套接字:
ws_uri: 'wss://XYZ:8433',
但是,我现在收到以下错误:
WebSocket connection to 'wss://XYZ:8433/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
kurento 服务器使用 letsencrypt 安全地运行在 HTTPS 上。我使用以下说明来保护服务器:
https://doc-kurento.readthedocs.org/en/latest/mastering/securing-kurento-applications.html
但是,在上面的示例中,它要求连接以下 crt 文件:
cat signing-ca.crt subordinate-ca.crt server.crt > server.pem
虽然我在这里很困惑,因为我找不到上述文件。 Letsencrypt 为我生成以下 .pem 文件:
cert.pem, chain.pem, fullchain.pem, privkey.pem
是否应该在 kurento.json.conf 文件中使用上述文件之一?
最佳答案
您已经有一个 certificate chain文件,正如文档中提到的:
If this PEM certificate is a signed certificate (by a Certificate Authority such as Verisign), then you are done.
Kurento需要私钥和全链,但是这些文件在使用letsencrypt时是分开生成的。您可以将 fullchain.pem
和您的 privkey.pem
与 cat privkey.pem fullchain.pem > server.pem
配置 Kurento 使用你的新文件 server.pem
作为它的 certificate
:
"secure": {
"port": 8433,
"certificate": "server.pem",
"password": ""
}
作为记录,如果您要 sign your own certificate ,您将使用 cat
来创建如下证书链:
root-ca ==> signing-ca ==> subordinate-ca ==> server
关于javascript - Kurento - WebSocket 连接失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35188332/