[FFmpeg-cvslog] avformat/tls_openssl: verify setting hostname for SNI

Marvin Scholz git at videolan.org
Tue Jul 22 03:58:44 EEST 2025


ffmpeg | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Jul  8 19:52:48 2025 +0200| [f4befeb7674978738ce3c7256545dfa49f3e40d7] | committer: Marvin Scholz

avformat/tls_openssl: verify setting hostname for SNI

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

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

diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
index 7845335811..49f26860b1 100644
--- a/libavformat/tls_openssl.c
+++ b/libavformat/tls_openssl.c
@@ -962,7 +962,11 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op
             ret = AVERROR_EXTERNAL;
             goto fail;
         }
-        SSL_set_tlsext_host_name(p->ssl, c->host);
+        if (!SSL_set_tlsext_host_name(p->ssl, c->host)) {
+            av_log(h, AV_LOG_ERROR, "Failed to set hostname for SNI: %s\n", openssl_get_error(p));
+            ret = AVERROR_EXTERNAL;
+            goto fail;
+        }
     }
     ret = c->listen ? SSL_accept(p->ssl) : SSL_connect(p->ssl);
     if (ret == 0) {



More information about the ffmpeg-cvslog mailing list