Skip to content

Commit

Permalink
Merge branch 'mh/maint-honor-no-ssl-verify' into maint
Browse files Browse the repository at this point in the history
* mh/maint-honor-no-ssl-verify:
  Don't verify host name in SSL certs when GIT_SSL_NO_VERIFY is set
  • Loading branch information
gitster committed Sep 19, 2008
2 parents e32c0a9 + a5ccc59 commit 6380d12
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion http.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,16 @@ static CURL* get_curl_handle(void)
{
CURL* result = curl_easy_init();

curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, curl_ssl_verify);
if (!curl_ssl_verify) {
curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 0);
} else {
/* Verify authenticity of the peer's certificate */
curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 1);
/* The name in the cert must match whom we tried to connect */
curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 2);
}

#if LIBCURL_VERSION_NUM >= 0x070907
curl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
#endif
Expand Down

0 comments on commit 6380d12

Please sign in to comment.