1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avformat/tls_openssl: set tlsext host name after init ssl

Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
Jack Lau
2025-07-17 07:38:54 +08:00
committed by Timo Rothenpieler
parent 2869cce163
commit 7afe1167e5

View File

@ -837,9 +837,6 @@ static int dtls_start(URLContext *h, const char *url, int flags, AVDictionary **
if (c->verify) if (c->verify)
SSL_CTX_set_verify(p->ctx, SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL); 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 */ /* Setup the SRTP context */
if (SSL_CTX_set_tlsext_use_srtp(p->ctx, profiles)) { 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", 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; goto fail;
} }
if (!c->listen && !c->numerichost)
SSL_set_tlsext_host_name(p->ssl, c->host);
/* Setup the callback for logging. */ /* Setup the callback for logging. */
SSL_set_ex_data(p->ssl, 0, p); SSL_set_ex_data(p->ssl, 0, p);
SSL_CTX_set_info_callback(p->ctx, openssl_info_callback); SSL_CTX_set_info_callback(p->ctx, openssl_info_callback);