Re: git 2.8.1 not working with socks5h https proxy anymore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On vr, 2016-04-08 at 20:46 +0200, Felix Ruess wrote:
> Hi all,
> 
> I just encountered a problem with the latest git version (2.8.1) that
> looks like a regression to me:
> When trying to clone a repo via a https socks5 proxy the connection
> times out:
> 
> $ git config --global 'http.proxy=socks5h://127.0.0.1:1080'
> $ export GIT_CURL_VERBOSE=1
> $ git clone https://foo.de/bar.git
> Cloning into 'bar'...
> * Couldn't find host foo.de in the .netrc file; using defaults
> * Hostname was NOT found in DNS cache
> *   Trying 127.0.0.1...
> * Hostname was NOT found in DNS cache
> * 80
> * 147
> * 201
> * 194
> channel 2: open failed: connect failed: Connection timed out
> channel 4: open failed: connect failed: Connection timed out
> * Failed to receive SOCKS5 connect request ack.
> * Closing connection 0
> fatal: unable to access 'https://foo.de/bar.git/': Failed to receive
> SOCKS5 connect request ack.
> 
> I'm on Ubuntu 14.04 64bit and it works perfectly fine with git 1.9.1
> (and was also working with older git 2.x versions, although not sure
> any more what the last working version was).

I think that's 6d7afe07f29df75f831a46fb0f657fa37e561779, which
interprets that as a socks5 proxy.

I think this should fix it (but haven't tested it beyond 'it
compiles'):

diff --git a/http.c b/http.c
index 69da445..4304b80 100644
--- a/http.c
+++ b/http.c
@@ -605,7 +605,10 @@ static CURL *get_curl_handle(void)
 	if (curl_http_proxy) {
 		curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
 #if LIBCURL_VERSION_NUM >= 0x071800
-		if (starts_with(curl_http_proxy, "socks5"))
+		if (starts_with(curl_http_proxy, "socks5h"))
+			curl_easy_setopt(result,
+				CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
+		else if (starts_with(curl_http_proxy, "socks5"))
 			curl_easy_setopt(result,
 				CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
 		else if (starts_with(curl_http_proxy, "socks4a"))

But I have no socks5h proxy to test with. Can you give this patch a spin?
-- 
Dennis Kaarsemaker
www.kaarsemaker.net


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]