sepfy / libpeer

WebRTC Library for IoT/Embedded Device using C
MIT License
804 stars 108 forks source link

Error:1420B114:SSL routines:ssl_read_internal:uninitialized #1

Closed ocampana closed 10 months ago

ocampana commented 3 years ago

I just followed you instrictions, after starting the session this is what I get on the console

[INFO /home/ottavio/Progetti/pear/src/ice_agent.c:148] SIGNAL: state changed 1 1 failed[5]
[INFO /home/ottavio/Progetti/pear/src/ice_agent.c:148] SIGNAL: state changed 1 1 connecting[2]
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized
[ERROR /home/ottavio/Progetti/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized

I am on Debian bullseye 64 bits and firefox.

tomlankhorst commented 3 years ago

Same on Ubuntu 20.04 LTS, libssl-dev 1.1.1f-1ubuntu2.3

SA7BNT commented 3 years ago

Same as @ocampana Running Jetson Nano 4gb aarch64 Ubuntu

[INFO /home/sa7bnt/pear/src/ice_agent.c:149] SIGNAL: state changed 1 1 failed[5] [INFO /home/sa7bnt/pear/src/ice_agent.c:149] SIGNAL: state changed 1 1 connecting[2] [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/sa7bnt/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized

regularfry commented 3 years ago

Same here, rpi zero w running Raspbian buster.

regularfry commented 3 years ago

Had a quick poke at the code. SSL_read needs SSL_set_accept_state to have been called first, but the SSL_set_accept_state call is only reached via a g_signal_connect callback. I'm not sure what triggers those events, but it sounds async to me. If that callback doesn't get called before the client connects (or... possibly... ever) then SSL_read won't know the connection's in server mode.

sepfy commented 3 years ago

Thank for your test. I developed this library with Chrome, so I think Chrome is working. When you click start session in the browser, it should callback to cb_new_selected_pair_full and do DTLS handshake. I am checking Firefox in this branch. By increasing idle time, it can pass the handshake and I saw Firefox has received RTP packet , but Firefox still is no video. I will continue to check that. Maybe you can try this with Chrome first.

binhlv2607 commented 3 years ago

Im running in google Chrome but still error INFO /home/pi/workspaces/pear/src/ice_agent.c:149] SIGNAL: state changed 1 1 failed[5] [INFO /home/pi/workspaces/pear/src/ice_agent.c:149] SIGNAL: state changed 1 1 connecting[2] [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized

SA7BNT commented 3 years ago

Im running in google Chrome but still error INFO /home/pi/workspaces/pear/src/ice_agent.c:149] SIGNAL: state changed 1 1 failed[5] [INFO /home/pi/workspaces/pear/src/ice_agent.c:149] SIGNAL: state changed 1 1 connecting[2] [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized

Can confirm that on Chromium aarch64 Ubuntu

regularfry commented 3 years ago

Yep. Chrome here too. Possibly relevant: I'm testing over the network, not locally. index.html is served up by a python -m SimpleHTTPServer. I don't think that should matter, if I've understood what libnice is doing correctly.

SA7BNT commented 3 years ago

Yep. Chrome here too. Possibly relevant: I'm testing over the network, not locally. index.html is served up by a python -m SimpleHTTPServer. I don't think that should matter, if I've understood what libnice is doing correctly.

Running on index.html on localhost.

binhlv2607 commented 3 years ago

Im running in google Chrome but still error INFO /home/pi/workspaces/pear/src/ice_agent.c:149] SIGNAL: state changed 1 1 failed[5] [INFO /home/pi/workspaces/pear/src/ice_agent.c:149] SIGNAL: state changed 1 1 connecting[2] [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized [ERROR /home/pi/workspaces/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized

Can confirm that on Chromium aarch64 Ubuntu

yep. I try to running index.html by google chrome in ubuntu ( my PC) and in my Raspberry, still error. How can i by pass SSL to tranfer video success?

sepfy commented 3 years ago

It's weird. My google chrome version is 85.0.4183.83 (Linux Mint 20) Maybe try this branch Or remove the lines 229 and 230 in ice_agent.c

I think that serve by SimpleHTTPServer or locally both are ok.

binhlv2607 commented 3 years ago

It's weird. My google chrome version is 85.0.4183.83 (Linux Mint 20) Maybe try this branch Or remove the lines 229 and 230 in ice_agent.c

I think that serve by SimpleHTTPServer or locally both are ok.

im try in new branch and remove 2 lines of your. still error.

sepfy commented 3 years ago

could you provide your remote sdp ?

binhlv2607 commented 3 years ago

could you provide your remote sdp ?

here: dj0wDQpvPS0gNjE2MjA4NjE5ODYwNjgwMjUzNiAyIElOIElQNCAxMjcuMC4wLjENCnM9LQ0KdD0wIDANCmE9Z3JvdXA6QlVORExFIDANCmE9ZXh0bWFwLWFsbG93LW1peGVkDQphPW1zaWQtc2VtYW50aWM6IFdNUw0KbT12aWRlbyAzNjgxNCBVRFAvVExTL1JUUC9TQVZQRiA5NiA5NyA5OCA5OSAxMDAgMTAxIDEwMiAxMjEgMTI3IDEyMCAxMjUgMTA3IDEwOCAxMDkgMTI0IDExOSAxMjMNCmM9SU4gSVA0IDE0LjIzMi4xNjQuMTAxDQphPXJ0Y3A6OSBJTiBJUDQgMC4wLjAuMA0KYT1jYW5kaWRhdGU6ODQy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LTVkZjg2YWUyMmJjNQ0KYT1zc3JjOjIwMjk4OTM5MSBjbmFtZTpQYUx0Uk1HeFBvOVUyV3lhDQphPXNzcmM6MjAyOTg5MzkxIG1zaWQ6LSA0NWU4YTFlYi0xY2MzLTQyYjctYmFmNC01ZGY4NmFlMjJiYzUNCmE9c3NyYzoyMDI5ODkzOTEgbXNsYWJlbDotDQphPXNzcmM6MjAyOTg5MzkxIGxhYmVsOjQ1ZThhMWViLTFjYzMtNDJiNy1iYWY0LTVkZjg2YWUyMmJjNQ0K

GrubbyHalo commented 3 years ago

I could not get this to work. I am getting the same error.... [ERROR /home/pi/pear/src/dtls_transport.c:185] error:1420B114:SSL routines:ssl_read_internal:uninitialized I am using Brave browser (Based on chrome) and the latest raspberry pi OS.

sepfy commented 3 years ago

Hi all,

I spent some time to test different environment. I ensure that the following environment are ok:

  1. Ubuntu 20.04 with chromium (install by apt-get chromium-browser).
  2. Raspberry Pi OS on Pi 4 with default chromium
  3. Jetson nano official SD card image with default chromium

If you use these environment, but still has some issues. I guess that reasons are network or instructions of example. For the instruction issue, maybe my document is not clear. So I created another example. It can help to exchange SDP by HTTP server. You can test it in the branch.Thanks

0xsky commented 3 years ago

I got the same error msg error:140DF114:SSL routines:SSL_read:uninitialized I found that the main reason was that the cb_new_selected_pair_full callback was not called, But the cause hasn't been found yet

sepfy commented 10 months ago

switch to mbedtls