All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nelson Benitez Leon <nelsonjesus.benitez@seap.minhap.es>
To: git@vger.kernel.org, peff@peff.net, sam@vilain.net
Subject: [PATCH v2 1/3]http: authenticate on NTLM proxies and others suppported by CuRL
Date: Thu, 01 Mar 2012 19:19:38 +0100	[thread overview]
Message-ID: <4F4FBDBA.8040609@seap.minhap.es> (raw)

CURLAUTH_ANY option automatically chooses the best auth method
from among those the server supports, that means curl
will ask the proxy and use the appropiate, and it will only do that if
you are using a proxy (i.e. you've set CURLOPT_PROXY or you have http_proxy
env var), also curl will not try to authenticate if you've not provided
username or password in the proxy string, as told here[1]..

so, setting CURLOPT_PROXYAUTH = CURLAUTH_ANY will not affect the speed of
normal curl use, only if 1) you are using a proxy and 2) your proxy requires
authentication, only then curl will just make two or three roundtrips to find out
the auth methods the proxy is using, that is a tiny cost compared to having the
user find out the proxy auth type and set manually a specific config option to
enable that type.

So as CURLAUTH_ANY provide us out-of-the-box proxy support without affecting speed,
we don't want it activated manually from a config option, instead we added it
automatically when a proxy is being used.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=769254#c6

Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
---
 http.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/http.c b/http.c
index 0ffd79c..8ac8eb6 100644
--- a/http.c
+++ b/http.c
@@ -295,8 +295,10 @@ static CURL *get_curl_handle(void)
 	if (curl_ftp_no_epsv)
 		curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);
 
-	if (curl_http_proxy)
+	if (curl_http_proxy) {
 		curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
+		curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
+	}
 
 	return result;
 }
-- 
1.7.7.6

             reply	other threads:[~2012-03-01 17:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 18:19 Nelson Benitez Leon [this message]
2012-03-01 19:07 ` [PATCH v2 1/3]http: authenticate on NTLM proxies and others suppported by CuRL Junio C Hamano
2012-03-02 13:55   ` Nelson Benitez Leon
2012-03-02 18:50     ` Junio C Hamano
2012-03-05 15:33       ` Nelson Benitez Leon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F4FBDBA.8040609@seap.minhap.es \
    --to=nelsonjesus.benitez@seap.minhap.es \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=sam@vilain.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.