]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/tls_securetransport.c
Merge commit 'c1d647b15afa69fa70f999a9ddcb98346409fb4d'
[ffmpeg] / libavformat / tls_securetransport.c
index 9951b905b4d62819c73e581b31870494ec507953..73662d78d25c054a8cf0d89d78d5841d5c4a9f58 100644 (file)
@@ -273,13 +273,13 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op
     if (s->ca_file) {
         if ((ret = load_ca(h)) < 0)
             goto fail;
-        CHECK_ERROR(SSLSetSessionOption, c->ssl_context, kSSLSessionOptionBreakOnServerAuth, true);
     }
+    if (s->ca_file || !s->verify)
+        CHECK_ERROR(SSLSetSessionOption, c->ssl_context, kSSLSessionOptionBreakOnServerAuth, true);
     if (s->cert_file)
         if ((ret = load_cert(h)) < 0)
             goto fail;
-    if (s->verify)
-        CHECK_ERROR(SSLSetPeerDomainName, c->ssl_context, s->host, strlen(s->host));
+    CHECK_ERROR(SSLSetPeerDomainName, c->ssl_context, s->host, strlen(s->host));
     CHECK_ERROR(SSLSetIOFuncs, c->ssl_context, tls_read_cb, tls_write_cb);
     CHECK_ERROR(SSLSetConnection, c->ssl_context, h);
     while (1) {