git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
@ 2015-10-20 11:20 Johan Laenen
  2015-10-20 11:46 ` Matthieu Moy
  0 siblings, 1 reply; 12+ messages in thread
From: Johan Laenen @ 2015-10-20 11:20 UTC (permalink / raw)
  To: git

Commit 5841520b makes it impossible to connect to github from behind my
company's firewall.

I'm running CYGWIN_NT-6.1 and the default git version 2.5.3 complains with a
fatal error when trying to git pull:

$ /bin/git --version
git version 2.5.3
$ /bin/git pull
fatal: unable to access 'https://github.com/gargle/french/': Unknown SSL
protocol error in connection to github.com:443

Taking the sources of git 2.6.1. and compiling with commit 5841520b in
http.c reverted gives me a working git.

My http.c now looks like:

 466     if (curl_http_proxy) {
 467         curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
 468 #if LIBCURL_VERSION_NUM >= 0x070a07
 469         curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
 470 #endif
 471     }

And it works:

$ git --version
git version 2.6.1
$ git pull
Already up-to-date.



Greetings,

Johan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
  2015-10-20 11:20 Commit 5841520b makes it impossible to connect to github from behind my company's firewall Johan Laenen
@ 2015-10-20 11:46 ` Matthieu Moy
  2015-10-20 13:39   ` Enrique Tobis
  0 siblings, 1 reply; 12+ messages in thread
From: Matthieu Moy @ 2015-10-20 11:46 UTC (permalink / raw)
  To: Johan Laenen; +Cc: git, Enrique Tobis

Hi,

I'm just Cc-ing Enrique, the author of 5841520b.

Johan Laenen <johan.laenen+cygwin@gmail.com> writes:

> Commit 5841520b makes it impossible to connect to github from behind my
> company's firewall.
>
> I'm running CYGWIN_NT-6.1 and the default git version 2.5.3 complains with a
> fatal error when trying to git pull:
>
> $ /bin/git --version
> git version 2.5.3
> $ /bin/git pull
> fatal: unable to access 'https://github.com/gargle/french/': Unknown SSL
> protocol error in connection to github.com:443
>
> Taking the sources of git 2.6.1. and compiling with commit 5841520b in
> http.c reverted gives me a working git.
>
> My http.c now looks like:
>
>  466     if (curl_http_proxy) {
>  467         curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
>  468 #if LIBCURL_VERSION_NUM >= 0x070a07
>  469         curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
>  470 #endif
>  471     }
>
> And it works:
>
> $ git --version
> git version 2.6.1
> $ git pull
> Already up-to-date.
>
>
>
> Greetings,
>
> Johan

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
  2015-10-20 11:46 ` Matthieu Moy
@ 2015-10-20 13:39   ` Enrique Tobis
  2015-10-20 14:23     ` Johan Laenen
  2015-10-20 16:11     ` Junio C Hamano
  0 siblings, 2 replies; 12+ messages in thread
From: Enrique Tobis @ 2015-10-20 13:39 UTC (permalink / raw)
  To: 'Matthieu Moy', Johan Laenen; +Cc: git@vger.kernel.org

Hey!

I'm really sorry to hear that.

That change should enable more forms of authentication with your proxy, but it does cause libcurl to choose the one it finds most secure, according to the docs (http://curl.haxx.se/libcurl/c/CURLOPT_HTTPAUTH.html) What kinds of authentication does your proxy use?

Thanks,
Enrique

-----Original Message-----
From: Matthieu Moy [mailto:Matthieu.Moy@grenoble-inp.fr] 
Sent: Tuesday, October 20, 2015 07:46
To: Johan Laenen
Cc: git@vger.kernel.org; Enrique Tobis
Subject: Re: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.

Hi,

I'm just Cc-ing Enrique, the author of 5841520b.

Johan Laenen <johan.laenen+cygwin@gmail.com> writes:

> Commit 5841520b makes it impossible to connect to github from behind my
> company's firewall.
>
> I'm running CYGWIN_NT-6.1 and the default git version 2.5.3 complains with a
> fatal error when trying to git pull:
>
> $ /bin/git --version
> git version 2.5.3
> $ /bin/git pull
> fatal: unable to access 'https://github.com/gargle/french/': Unknown SSL
> protocol error in connection to github.com:443
>
> Taking the sources of git 2.6.1. and compiling with commit 5841520b in
> http.c reverted gives me a working git.
>
> My http.c now looks like:
>
>  466     if (curl_http_proxy) {
>  467         curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
>  468 #if LIBCURL_VERSION_NUM >= 0x070a07
>  469         curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
>  470 #endif
>  471     }
>
> And it works:
>
> $ git --version
> git version 2.6.1
> $ git pull
> Already up-to-date.
>
>
>
> Greetings,
>
> Johan

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
  2015-10-20 13:39   ` Enrique Tobis
@ 2015-10-20 14:23     ` Johan Laenen
  2015-10-20 14:30       ` Johan Laenen
  2015-10-20 16:11     ` Junio C Hamano
  1 sibling, 1 reply; 12+ messages in thread
From: Johan Laenen @ 2015-10-20 14:23 UTC (permalink / raw)
  To: git

Enrique Tobis <Enrique.Tobis <at> twosigma.com> writes:

> 
> Hey!
> 
> I'm really sorry to hear that.
> 
> That change should enable more forms of authentication with your proxy,
but it does cause libcurl to choose
> the one it finds most secure, according to the docs
> (http://curl.haxx.se/libcurl/c/CURLOPT_HTTPAUTH.html) What kinds of
authentication does your
> proxy use?
> 
> Thanks,
> Enrique
> 

Hi,

Thanks for looking into this.

I'm behind a NTLM proxy :/

Greetings,

Johan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
  2015-10-20 14:23     ` Johan Laenen
@ 2015-10-20 14:30       ` Johan Laenen
  0 siblings, 0 replies; 12+ messages in thread
From: Johan Laenen @ 2015-10-20 14:30 UTC (permalink / raw)
  To: git

Johan Laenen <johan.laenen+cygwin <at> gmail.com> writes:

I'm not the only one. Another cygwin user is experiencing the exact same
problem, see http://permalink.gmane.org/gmane.os.cygwin/155039 for more info.

greetings,

Johan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
  2015-10-20 13:39   ` Enrique Tobis
  2015-10-20 14:23     ` Johan Laenen
@ 2015-10-20 16:11     ` Junio C Hamano
  2015-10-20 17:06       ` Enrique Tobis
  1 sibling, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2015-10-20 16:11 UTC (permalink / raw)
  To: Enrique Tobis; +Cc: 'Matthieu Moy', Johan Laenen, git@vger.kernel.org

Enrique Tobis <Enrique.Tobis@twosigma.com> writes:

> Hey!
>
> I'm really sorry to hear that.
>
> That change should enable more forms of authentication with your
> proxy, but it does cause libcurl to choose the one it finds most
> secure, according to the docs
> (http://curl.haxx.se/libcurl/c/CURLOPT_HTTPAUTH.html) What kinds of
> authentication does your proxy use?

Good line of thought.  The answer would reveal what non-working
authentication form the proxy claims to support is chosen because
libcurl considers more secure than the one the user wants to use.
I'd imagine that the next step after that would be to make the list
of authentication forms configurable so that the user can say "hey
my proxy claims to support this one but it does not work" to skip
it?

That sounds like a similar approach as what we did for SSL ciphers
in f6f2a9e4 (http: add support for specifying an SSL cipher list,
2015-05-08) where some people had problems with certain cipher the
server/client claimed to support when it was in fact broken.

Thanks.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
  2015-10-20 16:11     ` Junio C Hamano
@ 2015-10-20 17:06       ` Enrique Tobis
  2015-10-21  5:34         ` Johan Laenen
  2015-10-21  7:19         ` Johan Laenen
  0 siblings, 2 replies; 12+ messages in thread
From: Enrique Tobis @ 2015-10-20 17:06 UTC (permalink / raw)
  To: 'Junio C Hamano'
  Cc: 'Matthieu Moy', Johan Laenen, git@vger.kernel.org



From: Junio C Hamano [mailto:jch2355@gmail.com] On Behalf Of Junio C Hamano

> Enrique Tobis <Enrique.Tobis@twosigma.com> writes:

>> Hey!
>>
>> I'm really sorry to hear that.
>>
>> That change should enable more forms of authentication with your 
>> proxy, but it does cause libcurl to choose the one it finds most 
>> secure, according to the docs
>> (http://curl.haxx.se/libcurl/c/CURLOPT_HTTPAUTH.html) What kinds of 
>> authentication does your proxy use?

> Good line of thought.  The answer would reveal what non-working authentication form the proxy claims to support is chosen because libcurl considers  more secure than the one the user wants to use.
> I'd imagine that the next step after that would be to make the list of authentication forms configurable so that the user can say "hey my proxy claims to support this one but it does not work" to skip it?

> That sounds like a similar approach as what we did for SSL ciphers in f6f2a9e4 (http: add support for specifying an SSL cipher list,
2015-05-08) where some people had problems with certain cipher the server/client claimed to support when it was in fact broken.

> Thanks.

@Junio: I agree. From the post in the cygwin mailing list that Johan mentioned, the problem seems to be that the proxy supports NEGOTIATE, NTLM and Basic, and libcurl is choosing NEGOTIATE. That choice fails for that user.

There is something I don't understand, though. Johan must be configuring his proxy either a) through git config files; or b) through environment variables. Johan says his proxy uses NTLM authentication. If he is doing a), then my change should not have had any impact. We were already setting CURLOPT_PROXYAUTH to CURLAUTH_ANY in that case. If it's b), then his proxy couldn't have been using NTLM authentication. In the old code path, only _BASIC was available as an authentication mechanism. That default is what prompted me to make the change in the first place.

@Johan: how are you configuring your proxy? Git configuration or environment variables? Also, could you run GIT_CURL_VERBOSE=1 git pull and send the output. That should show the failing authentication method.

Thanks.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
  2015-10-20 17:06       ` Enrique Tobis
@ 2015-10-21  5:34         ` Johan Laenen
  2015-10-21  7:19         ` Johan Laenen
  1 sibling, 0 replies; 12+ messages in thread
From: Johan Laenen @ 2015-10-21  5:34 UTC (permalink / raw)
  To: git

Enrique Tobis <Enrique.Tobis <at> twosigma.com> writes:

>  <at> Johan: how are you configuring your proxy? Git configuration or
environment variables? Also, could you


I'm just using the https_proxy environment variable, not the git configuration:

$ export https_proxy=http://<userid>:<pw>@myproxy:8080



Sorry for the multiple attemps at answering your questions, but the mailing
list keeps on complaining about spam :/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
@ 2015-10-21  6:09 Johan Laenen
  0 siblings, 0 replies; 12+ messages in thread
From: Johan Laenen @ 2015-10-21  6:09 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

Enrique Tobis <Enrique.Tobis <at> twosigma.com> writes:

> run GIT_CURL_VERBOSE=1 git pull and send the output. That should show the failing authentication method.



Please see the file in attachment,

greetings,

Johan

[-- Attachment #2: git.txt --]
[-- Type: text/plain, Size: 2728 bytes --]

$ GIT_CURL_VERBOSE=1 /bin/git pull
* STATE: INIT => CONNECT handle 0x20081bd0; line 1090 (connection #-5000)
* Couldn't find host github.com in the .netrc file; using defaults
* Added connection 0. The cache now contains 1 members
*   Trying 10.192.45.149...
* STATE: CONNECT => WAITCONNECT handle 0x20081bd0; line 1143 (connection #0)
* Connected to myproxy (10.192.45.149) port 8080 (#0)
* STATE: WAITCONNECT => WAITPROXYCONNECT handle 0x20081bd0; line 1240 (connection #0)
* Establish HTTP proxy tunnel to github.com:443
> CONNECT github.com:443 HTTP/1.1
Host: github.com:443
User-Agent: git/2.5.3
Proxy-Connection: Keep-Alive

* Read response immediately from proxy CONNECT
< HTTP/1.1 407 Proxy Authentication Required
< Proxy-Authenticate: NEGOTIATE
< Proxy-Authenticate: NTLM
< Proxy-Authenticate: BASIC realm="POST_AD"
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Proxy-Connection: close
< Connection: close
< Content-Length: 1025
<
* Ignore 1025 bytes of response-body
* Connect me again please
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* Unknown SSL protocol error in connection to github.com:443
* Curl_done
* Closing connection 0
* The cache now contains 0 members
* STATE: WAITPROXYCONNECT => CONNECT handle 0x20081bd0; line 1223 (connection #-5000)
* Couldn't find host github.com in the .netrc file; using defaults
* Added connection 1. The cache now contains 1 members
* Hostname myproxy was found in DNS cache
*   Trying 10.192.45.149...
* STATE: CONNECT => WAITCONNECT handle 0x20081bd0; line 1143 (connection #1)
* Connected to myproxy (10.192.45.149) port 8080 (#1)
* STATE: WAITCONNECT => WAITPROXYCONNECT handle 0x20081bd0; line 1240 (connection #1)
* Establish HTTP proxy tunnel to github.com:443
> CONNECT github.com:443 HTTP/1.1
Host: github.com:443
User-Agent: git/2.5.3
Proxy-Connection: Keep-Alive

* Read response immediately from proxy CONNECT
< HTTP/1.1 407 Proxy Authentication Required
< Proxy-Authenticate: NEGOTIATE
* gss_init_sec_context() failed: : SPNEGO cannot find mechanisms to negotiate
< Proxy-Authenticate: NTLM
< Proxy-Authenticate: BASIC realm="POST_AD"
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Proxy-Connection: close
< Connection: close
< Content-Length: 1025
<
* Received HTTP code 407 from proxy after CONNECT
* Expire cleared
* Curl_done
* Closing connection 1
* The cache now contains 0 members
fatal: unable to access 'https://github.com/gargle/french/': Unknown SSL protocol error in connection to github.com:443

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
  2015-10-20 17:06       ` Enrique Tobis
  2015-10-21  5:34         ` Johan Laenen
@ 2015-10-21  7:19         ` Johan Laenen
  2015-10-21 18:29           ` Junio C Hamano
  1 sibling, 1 reply; 12+ messages in thread
From: Johan Laenen @ 2015-10-21  7:19 UTC (permalink / raw)
  To: git

Enrique Tobis <Enrique.Tobis <at> twosigma.com> writes:

> There is something I don't understand, though. Johan must be configuring
his proxy either a) through git
> config files; or b) through environment variables. Johan says his proxy
uses NTLM authentication. If he
> is doing a), then my change should not have had any impact. We were
already setting CURLOPT_PROXYAUTH to
> CURLAUTH_ANY in that case. If it's b), then his proxy couldn't have been
using NTLM authentication. In the
> old code path, only _BASIC was available as an authentication mechanism.
That default is what prompted me
> to make the change in the first place.

Interesting!

I tried both git versions, the one with the revert of commit 5841520b and
the one without and both gave me the fatal error "Unknown SSL protocol error
in connection to github.com:443" when using the ~/.gitconfig [https] and
[http] proxy settings instead of using the https_proxy environment variable.

Greetings,

Johan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
  2015-10-21  7:19         ` Johan Laenen
@ 2015-10-21 18:29           ` Junio C Hamano
  2015-10-21 18:45             ` Enrique Tobis
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2015-10-21 18:29 UTC (permalink / raw)
  To: Johan Laenen; +Cc: git, Matthieu Moy, Enrique Tobis

[administrivia: please do not cull people out of the Cc: list]

Johan Laenen <johan.laenen+cygwin@gmail.com> writes:

> Enrique Tobis <Enrique.Tobis <at> twosigma.com> writes:
>
>> There is something I don't understand, though. Johan must be
>> configuring his proxy either a) through git config files; or b)
>> through environment variables. Johan says his proxy uses NTLM
>> authentication. If he is doing a), then my change should not have
>> had any impact. We were already setting CURLOPT_PROXYAUTH to
>> CURLAUTH_ANY in that case. If it's b), then his proxy couldn't
>> have been using NTLM authentication. In the old code path, only
>> _BASIC was available as an authentication mechanism.  That
>> default is what prompted me to make the change in the first
>> place.
>
> Interesting!
>
> I tried both git versions, the one with the revert of commit 5841520b and
> the one without and both gave me the fatal error "Unknown SSL protocol error
> in connection to github.com:443" when using the ~/.gitconfig [https] and
> [http] proxy settings instead of using the https_proxy environment variable.

OK, so the conclusion I draw here is that your NTLM setting is not
working at all, you have been using Basic auth happily before that
commit, and you have to either (1) get NTLM auth working, or (2)
find a way to tell Git that your proxy appears to support NTLM
but it is unusable and you need to use Basic.

Even though you may be capable to do (1), other people in the same
situation might not be, in which case we would also need a way to do
(2).

Am I reading the above correctly?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Commit 5841520b makes it impossible to connect to github from behind my company's firewall.
  2015-10-21 18:29           ` Junio C Hamano
@ 2015-10-21 18:45             ` Enrique Tobis
  0 siblings, 0 replies; 12+ messages in thread
From: Enrique Tobis @ 2015-10-21 18:45 UTC (permalink / raw)
  To: 'Junio C Hamano', Johan Laenen; +Cc: git@vger.kernel.org, Matthieu Moy

From: Junio C Hamano [mailto:jch2355@gmail.com] On Behalf Of Junio C Hamano

[administrivia: please do not cull people out of the Cc: list]

Johan Laenen <johan.laenen+cygwin@gmail.com> writes:

> Enrique Tobis <Enrique.Tobis <at> twosigma.com> writes:
>
>> There is something I don't understand, though. Johan must be 
>> configuring his proxy either a) through git config files; or b) 
>> through environment variables. Johan says his proxy uses NTLM 
>> authentication. If he is doing a), then my change should not have had 
>> any impact. We were already setting CURLOPT_PROXYAUTH to CURLAUTH_ANY 
>> in that case. If it's b), then his proxy couldn't have been using 
>> NTLM authentication. In the old code path, only _BASIC was available 
>> as an authentication mechanism.  That default is what prompted me to 
>> make the change in the first place.
>
> Interesting!
>
> I tried both git versions, the one with the revert of commit 5841520b 
> and the one without and both gave me the fatal error "Unknown SSL 
> protocol error in connection to github.com:443" when using the 
> ~/.gitconfig [https] and [http] proxy settings instead of using the https_proxy environment variable.

> OK, so the conclusion I draw here is that your NTLM setting is not working at all, you have been using Basic auth happily before that commit, and you have to either (1) get NTLM auth working, or (2) find a way to tell Git that your proxy appears to support NTLM but it is unusable and you need to use Basic.

> Even though you may be capable to do (1), other people in the same situation might not be, in which case we would also need a way to do (2).

> Am I reading the above correctly?

I draw almost the same conclusions. I agree that he seems to have been using Basic all along. Based on the verbose output Johan posted, I think libcurl is trying to do NEGOTIATE instead of NTLM, so that's what Johan would have to get working. I also agree that other people may need to do (2).

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-10-21 18:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-20 11:20 Commit 5841520b makes it impossible to connect to github from behind my company's firewall Johan Laenen
2015-10-20 11:46 ` Matthieu Moy
2015-10-20 13:39   ` Enrique Tobis
2015-10-20 14:23     ` Johan Laenen
2015-10-20 14:30       ` Johan Laenen
2015-10-20 16:11     ` Junio C Hamano
2015-10-20 17:06       ` Enrique Tobis
2015-10-21  5:34         ` Johan Laenen
2015-10-21  7:19         ` Johan Laenen
2015-10-21 18:29           ` Junio C Hamano
2015-10-21 18:45             ` Enrique Tobis
  -- strict thread matches above, loose matches on Subject: below --
2015-10-21  6:09 Johan Laenen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).