0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

obs-outputs: Add additional paths for root certificates on Linux

Fixes https://github.com/obsproject/obs-studio/issues/2350. Also adds
some log file output for when the root certificates can't be loaded to
make it more obvious what the problem is.
This commit is contained in:
Richard Stanway 2020-01-25 16:49:11 +01:00
parent 2b131d212f
commit d1159087f1

View File

@ -344,14 +344,25 @@ RTMP_TLS_LoadCerts(RTMP *r) {
CFRelease(keychain_ref);
#elif defined(__linux__)
if (mbedtls_x509_crt_parse_path(chain, "/etc/ssl/certs/") < 0) {
RTMP_Log(RTMP_LOGERROR, "mbedtls_x509_crt_parse_path: Couldn't parse "
"/etc/ssl/certs");
goto error;
}
// mbedtls_x509_crt_parse_path ignores symlinks which causes an issue on
// some distributions. try parsing the most common CA bundles directly
// to work around this (we don't care if it fails)
mbedtls_x509_crt_parse_file(chain, "/etc/ssl/certs/ca-bundle.crt");
mbedtls_x509_crt_parse_file(chain, "/etc/ssl/certs/ca-certificates.crt");
#endif
mbedtls_ssl_conf_ca_chain(&r->RTMP_TLS_ctx->conf, chain, NULL);
return;
error:
RTMP_Log(RTMP_LOGERROR, "RTMP_TLS_LoadCerts: Failed to load "
"root certificate chains, RTMPS connections will likely "
"fail");
mbedtls_x509_crt_free(chain);
free(chain);
r->RTMP_TLS_ctx->cacert = NULL;