ZLMediaKit / ZLMediaKit

WebRTC/RTSP/RTMP/HTTP/HLS/HTTP-FLV/WebSocket-FLV/HTTP-TS/HTTP-fMP4/WebSocket-TS/WebSocket-fMP4/GB28181/SRT server and client framework based on C++11
https://docs.zlmediakit.com
Other
13.99k stars 3.42k forks source link

Cannot find any certificate of host. This kind of error is generally what reason. #3905

Open lilei-John opened 1 month ago

lilei-John commented 1 month ago

Phenomenon Description

Unable to play WebRTC video in Chrome

How to reproduce?

Always reproducible

Related logs or screenshots

./MediaServer -s ./default.pem 2024-09-18 09:46:13.438 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: H264 2024-09-18 09:46:13.438 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: H265 2024-09-18 09:46:13.439 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: JPEG 2024-09-18 09:46:13.439 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: mpeg4-generic 2024-09-18 09:46:13.439 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: opus 2024-09-18 09:46:13.440 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: PCMA 2024-09-18 09:46:13.440 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: PCMU 2024-09-18 09:46:13.440 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: L16 2024-09-18 09:46:13.441 I [MediaServer] [73658-MediaServer] System.cpp:192 systemSetup | core file size set to: 18446744073709551615 2024-09-18 09:46:13.441 I [MediaServer] [73658-MediaServer] System.cpp:201 systemSetup | maximum file descriptor count set to: 1048576 2024-09-18 09:46:13.441 I [MediaServer] [73658-MediaServer] main.cpp:256 start_main | ZLMediaKit(git hash:7c5ba5a/2024-09-10T10:59:44+08:00,branch:master,build time:2024-09-12T18:36:57) 2024-09-18 09:46:13.445 D [MediaServer] [73658-MediaServer] SSLBox.cpp:174 setContext | Add certificate of: default.zlmediakit.com 2024-09-18 09:46:13.446 D [MediaServer] [73658-stamp thread] util.cpp:366 operator() | Stamp thread started 2024-09-18 09:46:13.456 I [MediaServer] [73658-MediaServer] EventPoller.cpp:594 EventPollerPool | EventPoller created size: 2 2024-09-18 09:46:13.456 I [MediaServer] [73658-MediaServer] main.cpp:360 start_main | HTTP API interface started 2024-09-18 09:46:13.456 I [MediaServer] [73658-MediaServer] main.cpp:362 start_main | HTTP hook interface started 2024-09-18 09:46:13.457 I [MediaServer] [73658-MediaServer] TcpServer.cpp:221 start_l | TCP server listening on [192.168.1.104]: 554 2024-09-18 09:46:13.457 I [MediaServer] [73658-MediaServer] TcpServer.cpp:221 start_l | TCP server listening on [192.168.1.104]: 1935 2024-09-18 09:46:13.457 I [MediaServer] [73658-MediaServer] TcpServer.cpp:221 start_l | TCP server listening on [192.168.1.104]: 80 2024-09-18 09:46:13.458 I [MediaServer] [73658-MediaServer] TcpServer.cpp:221 start_l | TCP server listening on [192.168.1.104]: 443 2024-09-18 09:46:13.459 I [MediaServer] [73658-MediaServer] UdpServer.cpp:123 start_l | UDP server bind to [192.168.1.104]: 10000 2024-09-18 09:46:13.460 I [MediaServer] [73658-MediaServer] TcpServer.cpp:221 start_l | TCP server listening on [192.168.1.104]: 10000 2024-09-18 09:46:13.460 I [MediaServer] [73658-MediaServer] UdpServer.cpp:123 start_l | UDP server bind to [192.168.1.104]: 9000 2024-09-18 09:47:04.956 W [MediaServer] [73658-event poller 0] SSLBox.cpp:128 findCertificate | Can not find any certificate of host: 192.168.1.104, select default certificate of: default.zlmediakit.com

Expand to view detailed logs

```
#Please paste the detailed log here!
```

Configuration

Please expand to view detailed configuration

```ini
#Please paste the contents of the config.ini file here!
```
; auto-generated by mINI class {

[api]
apiDebug=1
defaultSnap=./www/logo.png
downloadRoot=./www
secret=8XgEgtKTKfCbFt20qEDUKrLD7faxdVkz
snapRoot=./www/snap/

[cluster]
origin_url=
retry_count=3
timeout_sec=15

[ffmpeg]
bin=/usr/bin/ffmpeg
cmd=%s -re -i %s -c:a aac -strict -2 -ar 44100 -ab 48k -c:v libx264 -f flv %s
log=./ffmpeg/ffmpeg.log
restart_sec=0
snap=%s -i %s -y -f mjpeg -frames:v 1 -an %s

[general]
broadcast_player_count_changed=0
check_nvidia_dev=1
enableVhost=0
enable_ffmpeg_log=0
flowThreshold=1024
listen_ip=192.168.1.104
maxStreamWaitMS=15000
mediaServerId=your_server_id
mergeWriteMS=0
resetWhenRePlay=1
streamNoneReaderDelayMS=20000
unready_frame_cache=100
wait_add_track_ms=3000
wait_track_ready_ms=10000

[hls]
broadcastRecordTs=0
deleteDelaySec=10
fastRegister=0
fileBufSize=65536
segDelay=0
segDur=2
segKeep=0
segNum=3
segRetain=5

[hook]
alive_interval=10.0
enable=0
on_flow_report=
on_http_access=
on_play=
on_publish=
on_record_mp4=
on_record_ts=
on_rtp_server_timeout=
on_rtsp_auth=
on_rtsp_realm=
on_send_rtp_stopped=
on_server_exited=
on_server_keepalive=
on_server_started=
on_shell_login=
on_stream_changed=
on_stream_none_reader=
on_stream_not_found=
retry=1
retry_delay=3.0
stream_changed_schemas=rtsp/rtmp/fmp4/ts/hls/hls.fmp4
timeoutSec=10

[http]
allow_cross_domains=1
allow_ip_range=::1,127.0.0.1,172.16.0.0-172.31.255.255,192.168.0.0-192.168.255.255,10.0.0.0-10.255.255.255
charSet=utf-8
dirMenu=1
forbidCacheSuffix=
forwarded_ip_header=
keepAliveSecond=30
maxReqSize=40960
notFound=404 Not Found

您访问的资源不存在!


ZLMediaKit(git hash:7c5ba5a/2024-09-10T10:59:44+08:00,branch:master,build time:2024-09-12T18:36:57)
port=80 rootPath=./www sendBufSize=65536 sslport=443 virtualPath= [multicast] addrMax=239.255.255.255 addrMin=239.0.0.0 udpTTL=64 [protocol] add_mute_audio=1 auto_close=0 continue_push_ms=15000 enable_audio=1 enable_fmp4=1 enable_hls=1 enable_hls_fmp4=0 enable_mp4=0 enable_rtmp=1 enable_rtsp=1 enable_ts=1 fmp4_demand=0 hls_demand=0 hls_save_path=./www modify_stamp=2 mp4_as_player=0 mp4_max_second=3600 mp4_save_path=./www paced_sender_ms=0 rtmp_demand=0 rtsp_demand=0 ts_demand=0 [record] appName=record enableFmp4=0 fastStart=0 fileBufSize=65536 fileRepeat=0 sampleMS=500 [rtc] externIP= maxRtpCacheMS=5000 maxRtpCacheSize=2048 max_bitrate=0 min_bitrate=0 nackIntervalRatio=1.0 nackMaxCount=15 nackMaxMS=3000 nackMaxSize=2048 nackRtpSize=8 port=8000 preferredCodecA=PCMA,PCMU,opus,mpeg4-generic preferredCodecV=H264,H265,AV1,VP9,VP8 rembBitRate=0 start_bitrate=0 tcpPort=8000 timeoutSec=15 [rtmp] directProxy=1 enhanced=0 handshakeSecond=15 keepAliveSecond=15 port=1935 sslport=0 [rtp] audioMtuSize=600 h264_stap_a=1 lowLatency=0 rtpMaxSize=10 videoMtuSize=1400 [rtp_proxy] dumpDir= gop_cache=1 h264_pt=98 h265_pt=99 opus_pt=100 port=10000 port_range=30000-35000 ps_pt=96 rtp_g711_dur_ms=100 timeoutSec=15 udp_recv_socket_buffer=4194304 [rtsp] authBasic=0 directProxy=1 handshakeSecond=15 keepAliveSecond=15 lowLatency=0 port=554 rtpTransportType=-1 sslport=0 [shell] maxReqSize=1024 port=0 [srt] latencyMul=4 pktBufSize=8192 port=9000 timeoutSec=5 ; } ---

Various environment information

ubuntu 18.04

现象描述

无法在chrome中播放webrtc视频 ## 如何复现? 必现 ## 相关日志或截图 ./MediaServer -s ./default.pem 2024-09-18 09:46:13.438 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: H264 2024-09-18 09:46:13.438 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: H265 2024-09-18 09:46:13.439 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: JPEG 2024-09-18 09:46:13.439 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: mpeg4-generic 2024-09-18 09:46:13.439 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: opus 2024-09-18 09:46:13.440 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: PCMA 2024-09-18 09:46:13.440 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: PCMU 2024-09-18 09:46:13.440 I [MediaServer] [73658-MediaServer] Factory.cpp:41 registerPlugin | Load codec: L16 2024-09-18 09:46:13.441 I [MediaServer] [73658-MediaServer] System.cpp:192 systemSetup | core文件大小设置为:18446744073709551615 2024-09-18 09:46:13.441 I [MediaServer] [73658-MediaServer] System.cpp:201 systemSetup | 文件最大描述符个数设置为:1048576 2024-09-18 09:46:13.441 I [MediaServer] [73658-MediaServer] main.cpp:256 start_main | ZLMediaKit(git hash:7c5ba5a/2024-09-10T10:59:44+08:00,branch:master,build time:2024-09-12T18:36:57) 2024-09-18 09:46:13.445 D [MediaServer] [73658-MediaServer] SSLBox.cpp:174 setContext | Add certificate of: default.zlmediakit.com 2024-09-18 09:46:13.446 D [MediaServer] [73658-stamp thread] util.cpp:366 operator() | Stamp thread started 2024-09-18 09:46:13.456 I [MediaServer] [73658-MediaServer] EventPoller.cpp:594 EventPollerPool | EventPoller created size: 2 2024-09-18 09:46:13.456 I [MediaServer] [73658-MediaServer] main.cpp:360 start_main | 已启动http api 接口 2024-09-18 09:46:13.456 I [MediaServer] [73658-MediaServer] main.cpp:362 start_main | 已启动http hook 接口 2024-09-18 09:46:13.457 I [MediaServer] [73658-MediaServer] TcpServer.cpp:221 start_l | TCP server listening on [192.168.1.104]: 554 2024-09-18 09:46:13.457 I [MediaServer] [73658-MediaServer] TcpServer.cpp:221 start_l | TCP server listening on [192.168.1.104]: 1935 2024-09-18 09:46:13.457 I [MediaServer] [73658-MediaServer] TcpServer.cpp:221 start_l | TCP server listening on [192.168.1.104]: 80 2024-09-18 09:46:13.458 I [MediaServer] [73658-MediaServer] TcpServer.cpp:221 start_l | TCP server listening on [192.168.1.104]: 443 2024-09-18 09:46:13.459 I [MediaServer] [73658-MediaServer] UdpServer.cpp:123 start_l | UDP server bind to [192.168.1.104]: 10000 2024-09-18 09:46:13.460 I [MediaServer] [73658-MediaServer] TcpServer.cpp:221 start_l | TCP server listening on [192.168.1.104]: 10000 2024-09-18 09:46:13.460 I [MediaServer] [73658-MediaServer] UdpServer.cpp:123 start_l | UDP server bind to [192.168.1.104]: 9000 2024-09-18 09:47:04.956 W [MediaServer] [73658-event poller 0] SSLBox.cpp:128 findCertificate | Can not find any certificate of host: 192.168.1.104, select default certificate of: default.zlmediakit.com
展开查看详细日志
```
#详细日志粘在这里!
```
## 配置
展开查看详细配置

```ini
#config.ini内容粘在这里!
```
; auto-generated by mINI class {

[api]
apiDebug=1
defaultSnap=./www/logo.png
downloadRoot=./www
secret=8XgEgtKTKfCbFt20qEDUKrLD7faxdVkz
snapRoot=./www/snap/

[cluster]
origin_url=
retry_count=3
timeout_sec=15

[ffmpeg]
bin=/usr/bin/ffmpeg
cmd=%s -re -i %s -c:a aac -strict -2 -ar 44100 -ab 48k -c:v libx264 -f flv %s
log=./ffmpeg/ffmpeg.log
restart_sec=0
snap=%s -i %s -y -f mjpeg -frames:v 1 -an %s

[general]
broadcast_player_count_changed=0
check_nvidia_dev=1
enableVhost=0
enable_ffmpeg_log=0
flowThreshold=1024
listen_ip=192.168.1.104
maxStreamWaitMS=15000
mediaServerId=your_server_id
mergeWriteMS=0
resetWhenRePlay=1
streamNoneReaderDelayMS=20000
unready_frame_cache=100
wait_add_track_ms=3000
wait_track_ready_ms=10000

[hls]
broadcastRecordTs=0
deleteDelaySec=10
fastRegister=0
fileBufSize=65536
segDelay=0
segDur=2
segKeep=0
segNum=3
segRetain=5

[hook]
alive_interval=10.0
enable=0
on_flow_report=
on_http_access=
on_play=
on_publish=
on_record_mp4=
on_record_ts=
on_rtp_server_timeout=
on_rtsp_auth=
on_rtsp_realm=
on_send_rtp_stopped=
on_server_exited=
on_server_keepalive=
on_server_started=
on_shell_login=
on_stream_changed=
on_stream_none_reader=
on_stream_not_found=
retry=1
retry_delay=3.0
stream_changed_schemas=rtsp/rtmp/fmp4/ts/hls/hls.fmp4
timeoutSec=10

[http]
allow_cross_domains=1
allow_ip_range=::1,127.0.0.1,172.16.0.0-172.31.255.255,192.168.0.0-192.168.255.255,10.0.0.0-10.255.255.255
charSet=utf-8
dirMenu=1
forbidCacheSuffix=
forwarded_ip_header=
keepAliveSecond=30
maxReqSize=40960
notFound=404 Not Found

您访问的资源不存在!


ZLMediaKit(git hash:7c5ba5a/2024-09-10T10:59:44+08:00,branch:master,build time:2024-09-12T18:36:57)
port=80 rootPath=./www sendBufSize=65536 sslport=443 virtualPath= [multicast] addrMax=239.255.255.255 addrMin=239.0.0.0 udpTTL=64 [protocol] add_mute_audio=1 auto_close=0 continue_push_ms=15000 enable_audio=1 enable_fmp4=1 enable_hls=1 enable_hls_fmp4=0 enable_mp4=0 enable_rtmp=1 enable_rtsp=1 enable_ts=1 fmp4_demand=0 hls_demand=0 hls_save_path=./www modify_stamp=2 mp4_as_player=0 mp4_max_second=3600 mp4_save_path=./www paced_sender_ms=0 rtmp_demand=0 rtsp_demand=0 ts_demand=0 [record] appName=record enableFmp4=0 fastStart=0 fileBufSize=65536 fileRepeat=0 sampleMS=500 [rtc] externIP= maxRtpCacheMS=5000 maxRtpCacheSize=2048 max_bitrate=0 min_bitrate=0 nackIntervalRatio=1.0 nackMaxCount=15 nackMaxMS=3000 nackMaxSize=2048 nackRtpSize=8 port=8000 preferredCodecA=PCMA,PCMU,opus,mpeg4-generic preferredCodecV=H264,H265,AV1,VP9,VP8 rembBitRate=0 start_bitrate=0 tcpPort=8000 timeoutSec=15 [rtmp] directProxy=1 enhanced=0 handshakeSecond=15 keepAliveSecond=15 port=1935 sslport=0 [rtp] audioMtuSize=600 h264_stap_a=1 lowLatency=0 rtpMaxSize=10 videoMtuSize=1400 [rtp_proxy] dumpDir= gop_cache=1 h264_pt=98 h265_pt=99 opus_pt=100 port=10000 port_range=30000-35000 ps_pt=96 rtp_g711_dur_ms=100 timeoutSec=15 udp_recv_socket_buffer=4194304 [rtsp] authBasic=0 directProxy=1 handshakeSecond=15 keepAliveSecond=15 lowLatency=0 port=554 rtpTransportType=-1 sslport=0 [shell] maxReqSize=1024 port=0 [srt] latencyMul=4 pktBufSize=8192 port=9000 timeoutSec=5 ; } ---

各种环境信息

ubuntu 18.04 * **代码提交记录/git commit hash**: * **操作系统及版本**: * **硬件信息**: * **crash backtrace**: ``` commit 7c5ba5a09964ef3f9a17e0c9acd869eccd18e8c6 (grafted, HEAD -> master, origin/master, origin/HEAD) Author: alex Date: Tue Sep 10 10:59:44 2024 +0800 Add pps structure and parsing function (#3875) #崩溃信息backtrace粘贴至此 ``` * **其他需要补充的信息**: `TRANS_BY_GITHUB_AI_ASSISTANT`
xiongguangjie commented 1 month ago

rtc.externIp needs to be configured as a public network IP (the IP that the client can access)

rtc.externIp 需要配置为公网IP(客户端可以访问到的IP)

TRANS_BY_GITHUB_AI_ASSISTANT

lilei-John commented 1 month ago

I am a LAN test, I use ubuntu, my ubuntu and PC browser are on the same LAN, my ubuntu can ping google

我是局域网测试,我使用的ubuntu,我的ubuntu和PC浏览器在同一个局域网,我的ubuntu可以ping,通google,我的PC可以ping通ubuntu

TRANS_BY_GITHUB_AI_ASSISTANT

xiongguangjie commented 1 month ago

I am a LAN test, I use ubuntu, my ubuntu and PC browser are on the same LAN, my ubuntu can ping google

我是局域网测试,我使用的ubuntu,我的ubuntu和PC浏览器在同一个局域网,我的ubuntu可以ping,通google,我的PC可以ping通ubuntu

TRANS_BY_GITHUB_AI_ASSISTANT 检查防火墙,是否端口未开放?