aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/tls_openssl.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2025-07-12 22:08:24 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2025-07-16 18:46:55 +0200
commitb6e808d28b784422aee5868583ee6c5239fab3d3 (patch)
tree8d2236298b1cc6ea17d061a0f72e8589d26717a9 /libavformat/tls_openssl.c
parentdb0adbbd3fcf0dc058d86d1f2bd29eb8c5f5880c (diff)
downloadffmpeg-b6e808d28b784422aee5868583ee6c5239fab3d3.tar.gz
avformat/tls_openssl: initialize DTLS context with correct method
Diffstat (limited to 'libavformat/tls_openssl.c')
-rw-r--r--libavformat/tls_openssl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
index 81b2f066c9..f116b5eac6 100644
--- a/libavformat/tls_openssl.c
+++ b/libavformat/tls_openssl.c
@@ -786,7 +786,7 @@ static int dtls_start(URLContext *h, const char *url, int flags, AVDictionary **
/* Refer to the test cases regarding these curves in the WebRTC code. */
const char* curves = "X25519:P-256:P-384:P-521";
- p->ctx = SSL_CTX_new(DTLS_method());
+ p->ctx = SSL_CTX_new(c->listen ? DTLS_server_method() : DTLS_client_method());
if (!p->ctx) {
ret = AVERROR(ENOMEM);
goto fail;
@@ -810,6 +810,7 @@ static int dtls_start(URLContext *h, const char *url, int flags, AVDictionary **
ret = AVERROR(EINVAL);
return ret;
}
+
ret = openssl_init_ca_key_cert(h);
if (ret < 0) goto fail;