We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e32c0a9 + a5ccc59 commit 6380d12Copy full SHA for 6380d12
http.c
@@ -165,7 +165,16 @@ static CURL* get_curl_handle(void)
165
{
166
CURL* result = curl_easy_init();
167
168
- curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, curl_ssl_verify);
+ if (!curl_ssl_verify) {
169
+ curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 0);
170
+ curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 0);
171
+ } else {
172
+ /* Verify authenticity of the peer's certificate */
173
+ curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 1);
174
+ /* The name in the cert must match whom we tried to connect */
175
+ curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 2);
176
+ }
177
+
178
#if LIBCURL_VERSION_NUM >= 0x070907
179
curl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
180
#endif
0 commit comments