{"thread":{"id":"1305","subject":"[PATCH 8/9] Support more http features: https no cert, .netrc -> auth","startedAt":"2005-07-23T00:30:15Z","lastAt":"2005-07-23T00:30:15Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"6357","messageId":"7v1x5qbbzc.fsf@assigned-by-dhcp.cox.net","threadId":"1305","inReplyTo":null,"subject":"[PATCH 8/9] Support more http features: https no cert, .netrc -> auth","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-07-23T00:30:15Z","receivedAt":"2005-07-23T00:30:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"From: Darrin Thompson <darrint@progeny.com>\nDate: 1121220760 -0500\n\nCause setting environment variable GIT_SSL_NO_VERIFY to turn off\ncurl's ssl peer verification.\n\nOnly use curl for http transfers, instead of curl and wget.\n\nMake curl check ~/.netrc for credentials.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n git-fetch-script |    7 +++++--\n http-pull.c      |    6 ++++++\n 2 files changed, 11 insertions(+), 2 deletions(-)\n\n1041908edea29758af81ac9452484cfc652f455c\ndiff --git a/git-fetch-script b/git-fetch-script\n--- a/git-fetch-script\n+++ b/git-fetch-script\n@@ -9,8 +9,11 @@ merge_store=\"$_remote_store\"\n TMP_HEAD=\"$GIT_DIR/TMP_HEAD\"\n \n case \"$merge_repo\" in\n-http://*)\n-\thead=$(wget -q -O - \"$merge_repo/$merge_head\") || exit 1\n+http://* | https://*)\n+        if [ -n \"$GIT_SSL_NO_VERIFY\" ]; then\n+            curl_extra_args=\"-k\"\n+        fi\n+\thead=$(curl -ns $curl_extra_args \"$merge_repo/$merge_head\") || exit 1\n \techo Fetching \"$merge_head\" using http\n \tgit-http-pull -v -a \"$head\" \"$merge_repo/\"\n \t;;\ndiff --git a/http-pull.c b/http-pull.c\n--- a/http-pull.c\n+++ b/http-pull.c\n@@ -16,6 +16,8 @@ static z_stream stream;\n static int local;\n static int zret;\n \n+static int curl_ssl_verify;\n+\n struct buffer\n {\n         size_t posn;\n@@ -173,6 +175,10 @@ int main(int argc, char **argv)\n \n \tcurl = curl_easy_init();\n \n+\tcurl_ssl_verify = gitenv(\"GIT_SSL_NO_VERIFY\") ? 0 : 1;\n+\tcurl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, curl_ssl_verify);\n+\tcurl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);\n+\n \tbase = url;\n \n \tif (pull(commit_id))\n"}]}