From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 0366450137 for ; Tue, 8 Jul 2025 18:16:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id E7BFC68F040; Tue, 8 Jul 2025 21:16:24 +0300 (EEST) Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id E0DD468E10B for ; Tue, 8 Jul 2025 21:16:23 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 568IGMrP016522 ; Tue, 8 Jul 2025 20:16:23 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id D768F2EFDF; Tue, 8 Jul 2025 20:16:22 +0200 (CEST) Date: Tue, 8 Jul 2025 20:16:22 +0200 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: References: <20250708180617.59679-1-epirat07@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250708180617.59679-1-epirat07@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 08 Jul 2025 20:16:23 +0200 (CEST) Subject: Re: [FFmpeg-devel] [PATCH 1/3] avformat/tls_openssl: add host verification X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marvin Scholz Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Marvin Scholz (HE12025-07-08): > From: Daniel N Pettersson > > Co-Authored-By: Marvin Scholz > --- > libavformat/tls_openssl.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c > index a0fa3285d5..7614caf089 100644 > --- a/libavformat/tls_openssl.c > +++ b/libavformat/tls_openssl.c > @@ -921,8 +921,15 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op > ret = init_bio_method(h); > if (ret < 0) > goto fail; > - if (!c->listen && !c->numerichost) > + if (!c->listen && !c->numerichost) { > + if (!SSL_set1_host(p->ssl, c->host)) { Must be optional. > + av_log(h, AV_LOG_ERROR, "Failed to set hostname for TLS/SSL verification: %s\n", > + openssl_get_error(p)); > + ret = AVERROR(EIO); AVERROR_EXTERNAL > + goto fail; > + } > SSL_set_tlsext_host_name(p->ssl, c->host); > + } > ret = c->listen ? SSL_accept(p->ssl) : SSL_connect(p->ssl); > if (ret == 0) { > av_log(h, AV_LOG_ERROR, "Unable to negotiate TLS/SSL session\n"); Regards, -- Nicolas George _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".