threads / discuss / 12333

FW: git via http protocol _and_ a proxy using NTLM authentication -- git 1.5.4.2 & curl 7.18.0

Subject: FW: git via http protocol _and_ a proxy using NTLM authentication -- git 1.5.4.2 & curl 7.18.0

## tl;dr

2 messages between Feb 26, 2008 and Feb 26, 2008.

replies: 1people: 2as markdown or json

ken.fuchs@bench.com· Feb 26, 2008, 21:43 UTC · lore

Need help to modify git to work with the http protocol _and_ a proxy using HTLM authentication.

--
The following changes were made to http.c (for NTLM authentication):
$ diff -c /mnt/nfs/git/git-1.5.4.2/http.c.orig \
    /mnt/nfs/git/git-1.5.4.2/http.c
--- 215,220 ----
--- 215,223 ----
        if (curl_http_proxy)
                curl_easy_setopt(result, CURLOPT_PROXY,
curl_http_proxy);
+       curl_easy_setopt(result, CURLOPT_PROXYAUTH,
(long)CURLAUTH_NTLM);
+       curl_easy_setopt(result, CURLOPT_PROXYUSERPWD,
+               "<user-id>:<password>");
+
        return result;
  }
$
--
git fetch _not_ working via an NTML proxy:
$ http_proxy=<proxy-domain>:<proxy-port> GIT_CURL_VERBOSE=1 \
    git fetch http://www.kernel.org/pub/scm/git/git.git

[A few paragraphs of proxy authentication debug output that BogoFilter apparently gives a high SPAM quotient to, so I've given up trying to include it.]

fatal: Couldn't find remote ref HEAD $

It seems that git fetch (via HTLM proxy) works until
> fatal: Couldn't find remote ref HEAD

git 1.5.4.2 dies on line 158 of builtin-fetch.c, because the call to get_remote_ref() in remote.c fails.

Does anything need to be changed in remote.c?
Any other suggestions?
Thanks,
Ken Fuchs
Daniel Stenberg· Feb 26, 2008, 22:01 UTC · re: ken.fuchs@bench.com · lore

Re: FW: git via http protocol _and_ a proxy using NTLM authentication -- git 1.5.4.2 & curl 7.18.0

On Tue, 26 Feb 2008, Ken.Fuchs@bench.com wrote:
> +       curl_easy_setopt(result, CURLOPT_PROXYAUTH, (long)CURLAUTH_NTLM);
> +       curl_easy_setopt(result, CURLOPT_PROXYUSERPWD,
> +               "<user-id>:<password>");

First, you should rather allow any auth and not just the specific one you want.

Then, the userid and password is probably better passed in embedded in the proxy URL as that's given on the command line/environment already. Or as separate arguments.

> It seems that git fetch (via HTLM proxy) works until
>
>> fatal: Couldn't find remote ref HEAD

Well, the CURLOPT_PROXY is set in transport.c as well which your patch didn't address. If that's the case, I figure the verbose output should've shown some auth failures with the proxy?

← back to recent threads