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

Couldn't parse /etc/ssl/certs #120

Open
bennlich opened this issue May 30, 2021 · 10 comments
Open

Couldn't parse /etc/ssl/certs #120

bennlich opened this issue May 30, 2021 · 10 comments
Labels
question Further information is requested

Comments

@bennlich
Copy link

Hey there. I'm on obs-studio 26.1.2-35-gbb6b1e53f.

I'm all of a sudden having trouble streaming to an rtmps endpoint I have used successfully in the past. From the logs:

info: mbedtls_x509_crt_parse_path: Couldn't parse /etc/ssl/certs
info: RTMP_TLS_LoadCerts: Failed to load root certificate chains, RTMPS connections will likely fail

and then

info: RTMP_Connect1, TLS_Connect failed: -0x7680

I found this related issue, but their solution did not work for me:
https://obsproject.com/forum/threads/tls_connect-failed-0x7680.121880/#post-457008

I have plenty of certs in /etc/ssl/certs. They are all symlinks to .crt files in /usr/share/ca-certificates/mozilla/, e.g.:

-rw-r--r-- 1 root root 1.5K Jan 28 04:01  TrustCor_ECA-1.crt
-rw-r--r-- 1 root root 1.5K Jan 28 04:01  TrustCor_RootCert_CA-1.crt
-rw-r--r-- 1 root root 2.2K Jan 28 04:01  TrustCor_RootCert_CA-2.crt
@slaff
Copy link

slaff commented Jun 2, 2021

info: mbedtls_x509_crt_parse_path: Couldn't parse /etc/ssl/certs

I am experiencing the same issue. Ubuntu version 16.04 LTS, Obs snap version: OBS Studio - 27.0.0-modified (linux). Is there a way to show more verbose information and see what exactly is mbedtls complaining about?

@slaff
Copy link

slaff commented Jun 2, 2021

I am not sure how snaps work but it seems that reading files in /etc and such is not allowed by default. If that is the case adding system-files-interface to the https://github.com/snapcrafters/obs-studio/blob/master/snap/snapcraft.yaml#L90 file and building a new snap should fix the issue.

@Enyer182
Copy link

Enyer182 commented Jul 5, 2021

I have this same issue, I have been following the thread, seems like there's a dependency missing for the RTMPS package.

@flexiondotorg
Copy link
Member

If I shell into the OBS Studio with snap run --shell obs-studio I can see /etc/ssl/certs.

On Ubuntu classic systems with snapd 2.50 or newer, a new feature was added where /etc/ssl inside the mount namespace of a strict snap is bind-mounted from the host system, not from the base snap.

Can you confirm is this issue is still happening?

Please also include the snap --version in any feedback.

@flexiondotorg flexiondotorg added the question Further information is requested label Oct 12, 2021
@bennlich
Copy link
Author

bennlich commented Oct 14, 2021

@flexiondotorg yes, still seeing this issue.

snap --version
snap    2.52.1
snapd   2.52.1
series  16
debian  9.0
kernel  4.19.0-14-amd64

If I shell into the OBS Studio with snap run --shell obs-studio I can see /etc/ssl/certs.

Me too.

@jidckii
Copy link

jidckii commented Jun 15, 2022

This problem has been raised in many issues, but has not yet been resolved.
What needs to be done to make it work?
Right now I'm using a workaround.
I am streaming to udp://localhost:1234 and then relaying to rtmps with ffmpeg, but that adds extra delay.

info: mbedtls_x509_crt_parse_path: Couldn't parse /etc/ssl/certs
info: RTMP_TLS_LoadCerts: Failed to load root certificate chains, RTMPS connections will likely fail
info: ---------------------------------
info: [FFMPEG VAAPI encoder: 'streaming_h264'] settings:
	device:       /dev/dri/by-path/pci-0000:00:02.0-render
	rate_control: CQP
	profile:      100
	level:        41
	qp:           23
	bitrate:      0
	maxrate:      0
	keyint:       120
	width:        1920
	height:       1020
	b-frames:     0

info: libfdk_aac encoder created
info: libfdk_aac bitrate: 160, channels: 2
info: [rtmp stream: 'adv_stream'] Connecting to RTMP URL rtmps://dc4-1.rtmp.t.me/s/...
info: RTMP_Connect1, TLS_Connect failed: -0x7680
info: [rtmp stream: 'adv_stream'] Connection to rtmps://dc4-1.rtmp.t.me/s/ failed: -2
info: ==== Streaming Stop ================================================

OS:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04 LTS
Release:	22.04
Codename:	jammy

snap:

$ snap --version
snap    2.56
snapd   2.56
series  16
ubuntu  22.04
kernel  5.15.0-37-generic

obs-studio latest from edge

$ sudo snap list | grep obs
obs-studio              27.2.1                      1287   latest/edge      snapcrafters   -

@big-vl
Copy link

big-vl commented May 27, 2024

ffmpeg -f flv -listen 1 -i rtmp://localhost:8889/live/app -c copy -f flv -flvflags no_duration_filesize rtmps://dc4-1.rtmp.t.me/s/

image

Start stream server to localhost, to send stream Telegram or Youtube.

@big-vl
Copy link

big-vl commented May 29, 2024

Example:
image

i write bash for reconnect server, i find problem in ffmpeg...

#!/bin/bash

# Ваши аргументы для ffmpeg
FFMPEG_ARGS="-f flv -listen 1 -i rtmp://localhost:8889/live/app -c copy -f flv -flvflags no_duration_filesize -reconnect_at_eof 1 -reconnect_streamed 1 rtmps://dc4-1.rtmp.t.me/s/"

while true; do
    echo "Starting ffmpeg..."
    ffmpeg $FFMPEG_ARGS
    
    # Если ffmpeg завершился с ошибкой, вывести сообщение и подождать 5 секунд перед перезапуском
    if [ $? -ne 0 ]; then
        echo "ffmpeg crashed with exit code $?. Restarting in 5 seconds..."
        sleep 2
    else
        # Если ffmpeg завершился успешно, выйти из цикла
        echo "ffmpeg finished successfully."
        break
    fi
done

or service:


[Unit]
Description=FFmpeg Stream
After=network.target

[Service]
ExecStart=/usr/bin/ffmpeg -f flv -listen 1 -i rtmp://localhost:8889/live/app -c copy -f flv -flvflags no_duration_filesize -reconnect_at_eof 1 -reconnect_streamed 1 rtmps://dc4-1.rtmp.t.me/s/
Restart=always
RestartSec=2

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start ffmpeg-stream
sudo systemctl enable ffmpeg-stream

@tam11a
Copy link

tam11a commented Aug 7, 2024

Anyone found any solution on the issue?

@big-vl
Copy link

big-vl commented Aug 23, 2024

Anyone found any solution on the issue?

Why don’t you like my decision?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants