[FFmpeg-cvslog] avformat/tls_openssl: set tlsext host name after init ssl

Jack Lau git at videolan.org
Thu Jul 17 03:37:20 EEST 2025


ffmpeg | branch: master | Jack Lau <jacklau1222 at qq.com> | Thu Jul 17 07:38:54 2025 +0800| [7afe1167e5d57fe28e91744d93f1ceebba12c0f3] | committer: Timo Rothenpieler

avformat/tls_openssl: set tlsext host name after init ssl

Signed-off-by: Jack Lau <jacklau1222 at qq.com>
Signed-off-by: Timo Rothenpieler <timo at rothenpieler.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7afe1167e5d57fe28e91744d93f1ceebba12c0f3
---

 libavformat/tls_openssl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
index 07d1af40d8..8200c644a9 100644
--- a/libavformat/tls_openssl.c
+++ b/libavformat/tls_openssl.c
@@ -837,9 +837,6 @@ static int dtls_start(URLContext *h, const char *url, int flags, AVDictionary **
     if (c->verify)
         SSL_CTX_set_verify(p->ctx, SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL);
 
-    if (!c->listen && !c->numerichost)
-        SSL_set_tlsext_host_name(p->ssl, c->host);
-
     /* Setup the SRTP context */
     if (SSL_CTX_set_tlsext_use_srtp(p->ctx, profiles)) {
         av_log(p, AV_LOG_ERROR, "TLS: Init SSL_CTX_set_tlsext_use_srtp failed, profiles=%s, %s\n",
@@ -855,6 +852,9 @@ static int dtls_start(URLContext *h, const char *url, int flags, AVDictionary **
         goto fail;
     }
 
+    if (!c->listen && !c->numerichost)
+        SSL_set_tlsext_host_name(p->ssl, c->host);
+
     /* Setup the callback for logging. */
     SSL_set_ex_data(p->ssl, 0, p);
     SSL_CTX_set_info_callback(p->ctx, openssl_info_callback);



More information about the ffmpeg-cvslog mailing list