Check empty string conditions for ssl_ca_file and ssl_ca_path

This commit is contained in:
Tatsuya Kinoshita
2021-02-12 23:49:47 +09:00
parent f0d17fecc4
commit 2cbf7f704d

3
url.c
View File

@@ -444,7 +444,8 @@ openSSLHandle(int sock, char *hostname, char **p_cert)
goto eend;
}
}
if ((!ssl_ca_file && !ssl_ca_path)
if ((!ssl_ca_file || *ssl_ca_file == '\0')
&& (!ssl_ca_path || *ssl_ca_path == '\0')
|| !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);