微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Ant 媒体 webrtc 连接到服务器给出 java.security.cert.CertPathValidatorException

如何解决Ant 媒体 webrtc 连接到服务器给出 java.security.cert.CertPathValidatorException

我正在尝试连接到 Ant 媒体 webrtc 服务器 wss://abcd.com:1234/demoApp/websocket。但是它总是抛出。

de.tavendo.autobahn.WebSocketReader: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
de.tavendo.autobahn.WebSocketWriter: Socket is closed

我正在使用 ant media webrtc 框架示例 android 示例并更改 URL。配合蚂蚁媒体的测试服务器运行正常

wss://test.antmedia.io:5443/demo1234/websocket(URL changed for security purposes)

但是我一直无法连接到主服务器。这是我用来连接服务器的 android 代码

webRTcclient = WebRTcclient(this@LiveSessionActivity,this)
webRTcclient.setVideoRenderers(mLiveSessionBinding?.pipVieWrenderer,mLiveSessionBinding?.localGLSurfaceView)
webRTcclient.init(ANT_MEDIA_URL,mLiveSessionviewmodel?.streamKey,IWebRTcclient.MODE_PUBLISH,"null",intent)

非常感谢任何帮助。谢谢!

解决方法

这是 v2.2.1 中的已知问题。您需要将 chain.pem 文件设置为 Ant Media Server。以下是说明:

复制chain.pem到conf。

sudo cp /etc/letsencrypt/live/your_domain/chain.pem /usr/local/antmedia/conf

PS:请将 your_domain 更改为您的域地址。

1- 添加这一行

http.ssl_certificate_chain_file=conf/chain.pem

之后

http.ssl_certificate_file=conf/fullchain.pem

/usr/local/antmedia/conf/red5.properties 文件中。

2- 添加这一行

<entry key="SSLCertificateChainFile" value="${http.ssl_certificate_chain_file}" />

之后

<entry key="SSLCertificateFile" value="${http.ssl_certificate_file}" /> 

/usr/local/antmedia/conf/jee-container.xml 文件中

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。