Skip to contentSkip to conversation

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

DISCUSSION Johan Laenen 4 participants 11 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

Hi,

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

Quoted 36 lines · Johan Laenen

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

Signature · 2 lines
Matthieu Moy
http://www-verimag.imag.fr/~moy/
#2 lore raw

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:[email protected]]
Sent: Tuesday, October 20, 2015 07:46
To: Johan Laenen
Cc: [email protected]; 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.

Quoted 36 lines · Johan Laenen

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

Signature · 2 lines
Matthieu Moy
http://www-verimag.imag.fr/~moy/
#3 lore raw
Quoted 6 lines · 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

Quoted 2 lines

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

Quoted 5 lines

proxy use?

Thanks,
Enrique

Hi,

Thanks for looking into this.

I'm behind a NTLM proxy :/

Greetings,

Johan

#5 lore raw
In reply to Enrique Tobis
Quoted 9 lines · Enrique Tobis

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.

#6 lore raw

From: Junio C Hamano [mailto:[email protected]] On Behalf Of Junio C Hamano

Quoted 12 lines
Quoted 9 lines · Enrique Tobis

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?

Quoted 4 lines

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.

Quoted 1 line

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.

#7 lore raw
Quoted 1 line · 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 :/

#8 lore raw
In reply to Enrique Tobis
Quoted 1 line · 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

Quoted 1 line

config files; or b) through environment variables. Johan says his proxy

uses NTLM authentication. If he

Quoted 1 line

is doing a), then my change should not have had any impact. We were

already setting CURLOPT_PROXYAUTH to

Quoted 1 line

CURLAUTH_ANY in that case. If it's b), then his proxy couldn't have been

using NTLM authentication. In the

Quoted 1 line

old code path, only _BASIC was available as an authentication mechanism.

That default is what prompted me

Quoted 1 line

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

#9 lore raw

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

Quoted 13 lines · Johan Laenen
Quoted 10 lines · 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.

Quoted 6 lines

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?

#10 lore raw

From: Junio C Hamano [mailto:[email protected]] On Behalf Of Junio C Hamano

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

Quoted 19 lines · Johan Laenen
Quoted 9 lines · 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.

Quoted 5 lines

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).