Use ssl_ca_file and ssl_ca_path only when ssl_verify_server

This commit is contained in:
Tatsuya Kinoshita
2021-02-13 13:56:00 +09:00
parent c710522a03
commit 1644c3b897

1
url.c
View File

@@ -446,6 +446,7 @@ openSSLHandle(int sock, char *hostname, char **p_cert)
}
if ((!ssl_ca_file || *ssl_ca_file == '\0')
&& (!ssl_ca_path || *ssl_ca_path == '\0')
|| !ssl_verify_server
|| !SSL_CTX_load_verify_locations(ssl_ctx, ssl_ca_file, ssl_ca_path))
#endif /* defined(USE_SSL_VERIFY) */
SSL_CTX_set_default_verify_paths(ssl_ctx);