{"thread":{"id":"29837","subject":"[PATCH v3 1/4] http: support proxies that needs authentication","startedAt":"2012-03-05T15:16:11Z","lastAt":"2012-03-05T17:30:55Z","messageCount":2,"participants":["Nelson Benitez Leon","Junio C Hamano"],"isPatch":true,"patchVersion":3,"patchTotal":4},"messages":[{"id":"186112","messageId":"4F54D8BB.4080305@seap.minhap.es","threadId":"29837","inReplyTo":null,"subject":"[PATCH v3 1/4] http: support proxies that needs authentication","fromName":"Nelson Benitez Leon","fromEmail":"nelsonjesus.benitez@seap.minhap.es","sentAt":"2012-03-05T15:16:11Z","receivedAt":"2012-03-05T15:16:11Z","isPatch":true,"sender":{"key":"nelsonjesus.benitez@seap.minhap.es","avatar":null},"body":"When the proxy server specified by the http.proxy configuration or\nthe http_proxy environment variable requires authentication, git\nfailed to connect to the proxy, because we did not configure the\ncURL handle with CURLOPT_PROXYAUTH.\n\nWhen a proxy is in use, and you tell git that the proxy requires\nauthentication by having username in the http.proxy configuration,\nan extra request needs to be made to the proxy to find out what\nauthentication method it supports, as this patch uses CURLAUTH_ANY\nto let the library pick the most secure method supported by the\nproxy server.\n\nThe extra round-trip adds extra latency, but relieves the user\nfrom the burden to configure a specific authentication method.  If\nit becomes problem, a later patch could add a configuration option\nto specify what method to use, but let's start simple for the time\nbeing.\n\nSigned-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>\n---\n http.c |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/http.c b/http.c\nindex 0ffd79c..8ac8eb6 100644\n--- a/http.c\n+++ b/http.c\n@@ -295,8 +295,10 @@ static CURL *get_curl_handle(void)\n \tif (curl_ftp_no_epsv)\n \t\tcurl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);\n \n-\tif (curl_http_proxy)\n+\tif (curl_http_proxy) {\n \t\tcurl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);\n+\t\tcurl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n+\t}\n \n \treturn result;\n }\n-- \n1.7.7.6\n"},{"id":"186126","messageId":"7vzkbv0xbk.fsf@alter.siamese.dyndns.org","threadId":"29837","inReplyTo":"4F54D8BB.4080305@seap.minhap.es","subject":"Re: [PATCH v3 1/4] http: support proxies that needs authentication","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-05T17:30:55Z","receivedAt":"2012-03-05T17:30:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; I think I already have the same change.\n"}]}