{"thread":{"id":"12333","subject":"FW: git via http protocol _and_ a proxy using NTLM authentication -- git 1.5.4.2 & curl 7.18.0","startedAt":"2008-02-26T21:43:30Z","lastAt":"2008-02-26T22:01:49Z","messageCount":2,"participants":["ken.fuchs@bench.com","Daniel Stenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"70035","messageId":"AA28F077645B324881335614E4F7C428034C00@win-ex01.bench.com","threadId":"12333","inReplyTo":null,"subject":"FW: git via http protocol _and_ a proxy using NTLM authentication -- git 1.5.4.2 & curl 7.18.0","fromName":"","fromEmail":"ken.fuchs@bench.com","sentAt":"2008-02-26T21:43:30Z","receivedAt":"2008-02-26T21:43:30Z","isPatch":false,"sender":{"key":"ken.fuchs@bench.com","avatar":null},"body":"Need help to modify git to work with the http protocol _and_\na proxy using HTLM authentication.\n\n--\n\nThe following changes were made to http.c (for NTLM authentication):\n\n$ diff -c /mnt/nfs/git/git-1.5.4.2/http.c.orig \\\n    /mnt/nfs/git/git-1.5.4.2/http.c\n--- 215,220 ----\n--- 215,223 ----\n        if (curl_http_proxy)\n                curl_easy_setopt(result, CURLOPT_PROXY,\ncurl_http_proxy);\n\n+       curl_easy_setopt(result, CURLOPT_PROXYAUTH,\n(long)CURLAUTH_NTLM);\n+       curl_easy_setopt(result, CURLOPT_PROXYUSERPWD,\n+               \"<user-id>:<password>\");\n+\n        return result;\n  }\n$\n\n--\n\ngit fetch _not_ working via an NTML proxy:\n\n$ http_proxy=<proxy-domain>:<proxy-port> GIT_CURL_VERBOSE=1 \\\n    git fetch http://www.kernel.org/pub/scm/git/git.git\n\n[A few paragraphs of proxy authentication debug output that\nBogoFilter apparently gives a high SPAM quotient to, so I've\ngiven up trying to include it.]\n\nfatal: Couldn't find remote ref HEAD\n$ \n\nIt seems that git fetch (via HTLM proxy) works until\n\n> fatal: Couldn't find remote ref HEAD\n\ngit 1.5.4.2 dies on line 158 of builtin-fetch.c,\nbecause the call to get_remote_ref() in remote.c fails.\n\nDoes anything need to be changed in remote.c?\n\nAny other suggestions?\n\nThanks,\n\nKen Fuchs\n"},{"id":"70036","messageId":"Pine.LNX.4.64.0802262254240.13009@yvahk3.pbagnpgbe.fr","threadId":"12333","inReplyTo":"AA28F077645B324881335614E4F7C428034C00@win-ex01.bench.com","subject":"Re: FW: git via http protocol _and_ a proxy using NTLM authentication -- git 1.5.4.2 & curl 7.18.0","fromName":"Daniel Stenberg","fromEmail":"daniel@haxx.se","sentAt":"2008-02-26T22:01:49Z","receivedAt":"2008-02-26T22:01:49Z","isPatch":false,"sender":{"key":"daniel@haxx.se","avatar":"https://gravatar.com/avatar/69fdca87edd17cee21ca2e79fc2ff671d644603c3dc27167430f3cd3dbab7ba8?d=mp&s=160"},"body":"On Tue, 26 Feb 2008, Ken.Fuchs@bench.com wrote:\n\n> +       curl_easy_setopt(result, CURLOPT_PROXYAUTH, (long)CURLAUTH_NTLM);\n> +       curl_easy_setopt(result, CURLOPT_PROXYUSERPWD,\n> +               \"<user-id>:<password>\");\n\nFirst, you should rather allow any auth and not just the specific one you \nwant.\n\nThen, the userid and password is probably better passed in embedded in the \nproxy URL as that's given on the command line/environment already. Or as \nseparate arguments.\n\n> It seems that git fetch (via HTLM proxy) works until\n>\n>> fatal: Couldn't find remote ref HEAD\n\nWell, the CURLOPT_PROXY is set in transport.c as well which your patch didn't \naddress. If that's the case, I figure the verbose output should've shown some \nauth failures with the proxy?\n"}]}