History

avformat/tls_openssl: load default verify locations

When no explicit CAs file is set, load the default locations, else there is no way for verification to succeed. This matches the behavior of other TLS backends.

Marvin Scholz committed 1 year ago

Commit 080dc4c1 parent f4befeb1 file · +6 −0Browse files

Unified · Split

libavformat/tls_openssl.c+6−0
@@ -740,6 +740,12 @@ static av_cold int openssl_init_ca_key_cert(URLContext *h) · 739 unmodified lines
740740 if (c->ca_file) {
741741 if (!SSL_CTX_load_verify_locations(p->ctx, c->ca_file, NULL))
742742 av_log(h, AV_LOG_ERROR, "SSL_CTX_load_verify_locations %s\n", openssl_get_error(p));
743+ } else {
744+ if (!SSL_CTX_set_default_verify_paths(p->ctx)) {
745+ // Only log the failure but do not error out, as this is not fatal
746+ av_log(h, AV_LOG_WARNING, "Failure setting default verify locations: %s\n",
747+ openssl_get_error(p));
748+ }
743749 }
744750
745751 if (c->cert_file) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t