Use ssl_ca_file and ssl_ca_path only when ssl_verify_server
This commit is contained in:
1
url.c
1
url.c
@@ -446,6 +446,7 @@ openSSLHandle(int sock, char *hostname, char **p_cert)
|
|||||||
}
|
}
|
||||||
if ((!ssl_ca_file || *ssl_ca_file == '\0')
|
if ((!ssl_ca_file || *ssl_ca_file == '\0')
|
||||||
&& (!ssl_ca_path || *ssl_ca_path == '\0')
|
&& (!ssl_ca_path || *ssl_ca_path == '\0')
|
||||||
|
|| !ssl_verify_server
|
||||||
|| !SSL_CTX_load_verify_locations(ssl_ctx, ssl_ca_file, ssl_ca_path))
|
|| !SSL_CTX_load_verify_locations(ssl_ctx, ssl_ca_file, ssl_ca_path))
|
||||||
#endif /* defined(USE_SSL_VERIFY) */
|
#endif /* defined(USE_SSL_VERIFY) */
|
||||||
SSL_CTX_set_default_verify_paths(ssl_ctx);
|
SSL_CTX_set_default_verify_paths(ssl_ctx);
|
||||||
|
|||||||
Reference in New Issue
Block a user