History

avformat/tls_openssl: use SSL_CTX_set_min_proto_version

Using SSL_CTX_set_options to disallow specific versions is discouraged by the documentation, which recommends to use SSL_CTX_set_min_proto_version instead.

Marvin Scholz committed 1 year ago

Commit 019ca5f1 parent fb38d871 file · +5 −1Browse files

Unified · Split

libavformat/tls_openssl.c+5−1
@@ -899,7 +899,11 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op · 898 unmodified lines
899899 ret = AVERROR(EIO);
900900 goto fail;
901901 }
902− SSL_CTX_set_options(p->ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
902+ if (!SSL_CTX_set_min_proto_version(p->ctx, TLS1_VERSION)) {
903+ av_log(h, AV_LOG_ERROR, "Failed to set minimum TLS version to TLSv1\n");
904+ ret = AVERROR_EXTERNAL;
905+ goto fail;
906+ }
903907 ret = openssl_init_ca_key_cert(h);
904908 if (ret < 0) goto fail;
905909 // Note, this doesn't check that the peer certificate actually matches

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