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

avformat/tls_openssl: verify setting hostname for SNI

This commit is contained in:
Marvin Scholz
2025-07-08 19:52:48 +02:00
parent e56fd2af1a
commit f4befeb767

View File

@ -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) {