Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handshake error on Https API #3029

Closed
Alijaaan opened this issue May 4, 2022 · 3 comments
Closed

Handshake error on Https API #3029

Alijaaan opened this issue May 4, 2022 · 3 comments
Assignees
Labels
TransByAI Translated by AI/GPT.

Comments

@Alijaaan
Copy link

Alijaaan commented May 4, 2022

Note: Please read FAQ before file an issue, see 2716

Note: Before asking a question, please refer to the FAQ, specifically 2716.

Description (描述)

Please description your issue here(handshake error on https api)

  1. SRS Version (版本): v4.0.245

  2. SRS Log (日志):

[2022-05-04 07:27:07.444][Trace][1][780k4yt9] srs checking config...
[2022-05-04 07:27:07.445][Trace][1][780k4yt9] ips, iface[0] eth0 ipv4 0x11043 172.17.0.2
[2022-05-04 07:27:07.445][Trace][1][780k4yt9] devices, intranet eth0 172.17.0.2
[2022-05-04 07:27:07.445][Warn][1][780k4yt9][22] stats network use index=0, ip=172.17.0.2, ifname=eth0
[2022-05-04 07:27:07.445][Warn][1][780k4yt9][22] stats disk not configed, disk iops disabled.
[2022-05-04 07:27:07.445][Trace][1][780k4yt9] write log to console
[2022-05-04 07:27:07.445][Trace][1][780k4yt9] features, rch:on, dash:on, hls:on, hds:off, srt:on, hc:on, ha:on, hs:on, hp:on, dvr:on, trans:on, inge:on, stat:on, sc:on
[2022-05-04 07:27:07.446][Trace][1][780k4yt9] SRS on  amd64 x86_64, conf:conf/https.rtc.conf, limit:1000, writev:1024, encoding:little-endian, HZ:100
[2022-05-04 07:27:07.446][Trace][1][780k4yt9] mw sleep:350ms. mr enabled:on, default:0, sleep:350ms
[2022-05-04 07:27:07.446][Trace][1][780k4yt9] gc:on, pq:30000ms, cscc:[0,16), csa:on, tn:on(may hurts performance), ss:auto(guess by merged write)
[2022-05-04 07:27:07.446][Trace][1][780k4yt9] system default latency(ms): mw(0-350) + mr(0-350) + play-queue(0-30000)
[2022-05-04 07:27:07.446][Warn][1][780k4yt9][22] SRS/4.0.166 is not stable
[2022-05-04 07:27:07.468][Trace][1][780k4yt9] fingerprint=33:F5:4C:65:35:03:86:B0:11:6D:4E:E4:63:D1:E5:C4:EE:A4:87:76:DD:60:B9:5A:E5:14:3B:5C:99:34:EB:B3
[2022-05-04 07:27:07.468][Trace][1][780k4yt9] CircuitBreaker: enabled=1, high=2x90, critical=1x95, dying=5x99
[2022-05-04 07:27:07.469][Trace][1][780k4yt9] http: root mount to ./objs/nginx/html
[2022-05-04 07:27:07.469][Trace][1][780k4yt9] server main cid=780k4yt9, pid=1, ppid=0, asprocess=0
[2022-05-04 07:27:07.470][Trace][1][780k4yt9] write pid=1 to ./objs/srs.pid success!
[2022-05-04 07:27:07.471][Trace][1][780k4yt9] RTMP listen at tcp://0.0.0.0:1935, fd=7
[2022-05-04 07:27:07.471][Trace][1][780k4yt9] HTTP-API listen at tcp://0.0.0.0:1985, fd=8
[2022-05-04 07:27:07.471][Trace][1][780k4yt9] HTTPS-API listen at tcp://0.0.0.0:1990, fd=9
[2022-05-04 07:27:07.471][Trace][1][780k4yt9] HTTP-Server listen at tcp://0.0.0.0:8080, fd=10
[2022-05-04 07:27:07.472][Trace][1][780k4yt9] HTTP-Server listen at tcp://0.0.0.0:8088, fd=11
[2022-05-04 07:27:07.472][Trace][1][780k4yt9] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3
[2022-05-04 07:27:07.472][Trace][1][780k4yt9] http: api mount /console to ./objs/nginx/html/console
[2022-05-04 07:27:07.473][Trace][1][780k4yt9] rtc listen at udp://0.0.0.0:8000, fd=12
[2022-05-04 07:27:07.495][Trace][1][xv8yy620] Hybrid cpu=0.00%,8MB
[2022-05-04 07:27:07.495][Warn][1][3q765g8m][22] use private address as ip: 172.17.0.2, ifname=eth0
[2022-05-04 07:27:07.495][Trace][1][3q765g8m] Startup query id=9a79677ccb7b11ecb3af3dbb49d0d6ca, eip=172.17.0.2, wait=522s
[2022-05-04 07:27:07.496][Trace][1][6l57296a] TCP: connection manager run, conns=0
[2022-05-04 07:27:07.496][Warn][1][780k4yt9][11] enable auto reload for docker
[2022-05-04 07:27:07.496][Trace][1][780k4yt9] auto reload watching fd=13, watch=1, file=conf
[2022-05-04 07:27:07.498][Trace][1][4vgm3245] UDP #12 LISTEN at 0.0.0.0:8000, SO_SNDBUF(default=212992, expect=10485760, actual=425984, r0=0), SO_RCVBUF(default=212992, expect=10485760, actual=425984, r0=0)
[2022-05-04 07:27:07.498][Trace][1][ik91ul3q] RTC: connection manager run, conns=0
[2022-05-04 07:27:12.436][Trace][1][xv8yy620] Hybrid cpu=1.00%,8MB
[2022-05-04 07:27:12.813][Trace][1][57j1871r] TCP: before dispose resource(HttpsConn)(0x1dce810), conns=2, zombies=0, ign=0, inz=0, ind=0
[2022-05-04 07:27:12.813][Error][1][57j1871r][2] serve error code=4045 : start : handshake : use cert ./conf/server.crt
thread [1][57j1871r]: do_cycle() [src/app/srs_app_http_conn.cpp:153][errno=2]
thread [1][57j1871r]: on_start() [src/app/srs_app_http_api.cpp:1412][errno=2]
thread [1][57j1871r]: handshake() [src/app/srs_app_conn.cpp:640][errno=2](No such file or directory)
[2022-05-04 07:27:12.813][Trace][1][9907197n] TCP: before dispose resource(HttpsConn)(0x1e00ec0), conns=2, zombies=1, ign=0, inz=0, ind=0
[2022-05-04 07:27:12.814][Error][1][9907197n][2] serve error code=4045 : start : handshake : use cert ./conf/server.crt
thread [1][9907197n]: do_cycle() [src/app/srs_app_http_conn.cpp:153][errno=2]
thread [1][9907197n]: on_start() [src/app/srs_app_http_api.cpp:1412][errno=2]
thread [1][9907197n]: handshake() [src/app/srs_app_conn.cpp:640][errno=2](No such file or directory)
[2022-05-04 07:27:12.814][Trace][1][6l57296a] TCP: clear zombies=2 resources, conns=2, removing=0, unsubs=0
[2022-05-04 07:27:12.814][Trace][1][57j1871r] TCP: disposing #0 resource(HttpsConn)(0x1dce810), conns=2, disposing=2, zombies=0
[2022-05-04 07:27:12.814][Trace][1][9907197n] TCP: disposing #1 resource(HttpsConn)(0x1e00ec0), conns=1, disposing=2, zombies=0
[2022-05-04 07:27:12.817][Trace][1][52w39921] TCP: before dispose resource(HttpsConn)(0x1e00ec0), conns=1, zombies=0, ign=0, inz=0, ind=0
[2022-05-04 07:27:12.817][Error][1][52w39921][2] serve error code=4045 : start : handshake : use cert ./conf/server.crt
thread [1][52w39921]: do_cycle() [src/app/srs_app_http_conn.cpp:153][errno=2]
thread [1][52w39921]: on_start() [src/app/srs_app_http_api.cpp:1412][errno=2]
thread [1][52w39921]: handshake() [src/app/srs_app_conn.cpp:640][errno=2](No such file or directory)
[2022-05-04 07:27:12.817][Trace][1][6l57296a] TCP: clear zombies=1 resources, conns=1, removing=0, unsubs=0
[2022-05-04 07:27:12.817][Trace][1][52w39921] TCP: disposing #0 resource(HttpsConn)(0x1e00ec0), conns=1, disposing=1, zombies=0
  1. SRS Config (配置):
listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;

http_server {
    enabled         off;
    listen          8080;
    dir             ./objs/nginx/html;
    https {
        enabled on;
        listen 8088;
        key ./conf/server.key;
        cert ./conf/server.crt;
    }
}

http_api {
    enabled         off;
    listen          1985;
    https {
        enabled on;
        listen 1990;
        key ./conf/server.key;
        cert ./conf/server.crt;
    }
}
stats {
    network         0;
}
rtc_server {
    enabled         on;
    listen 8000; # UDP port
    # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate
    candidate       194.5.175.130;
}

vhost __defaultVhost__ {
    rtc {
        enabled     on;
        # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtmp-to-rtc
        rtmp_to_rtc off;
        # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtc-to-rtmp
        rtc_to_rtmp off;
    }
    http_remux {
        enabled     off;
        mount       [vhost]/[app]/[stream].flv;
    }
}

Replay (重现)

Please describe how to replay the bug? (重现Bug的步骤)

  1. First I created server.crt and server.key as described in documents for my server in ./conf
  2. then run the server by https.rtc.conf : docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 -p 1990:1990 -p 8088:8088 --env CANDIDATE="my Ip" -p 8000:8000/udp ossrs/srs:4 ./objs/srs -c conf/https.rtc.conf
  3. When I try to send publish or play to API I receive handshake error
  4. then I tried with my own crt and key with certbot and tested again but the result was the same with handshake error

Expect (Expected Behavior)

Please describe your expectation(I don't know how to solve this handshake error)

TRANS_BY_GPT3

@Alijaaan
Copy link
Author

Alijaaan commented May 7, 2022

Is there any help for this problem?

@Alijaaan
Copy link
Author

Alijaaan commented May 9, 2022

I bought standard SSL but Still I have handshake error.
Is there any help, where is my fault? please .

@winlinvip
Copy link
Member

Please use NGINX to serve HTTPS and proxy to SRS, if you can't make it work. #2881

@winlinvip winlinvip self-assigned this May 21, 2022
@winlinvip winlinvip closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2022
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

2 participants