threads / discuss / 12347

RE: FW: git via http protocol _and_ a proxy using NTLMauthentication -- git 1.5.4.2 & curl 7.18.0

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

## tl;dr

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

replies: 1people: 2as markdown or json

ken.fuchs@bench.com· Feb 27, 2008, 22:10 UTC · lore
> Ken Fuchs wrote:
Current changes to http.c, get_curl_handle()
        and transport.c, get_refs_via_curl():
> > +       curl_easy_setopt(slot->curl, CURLOPT_PROXYAUTH,
> > (long)CURLAUTH_NTLM);
> > +       curl_easy_setopt(slot->curl, CURLOPT_PROXYUSERPWD,
> > "<user-id>:<password>");
Mike Hommey wrote: 
 
> Starting with curl 7.14.1, you're supposed to be able to use the
> http://user:pass@proxy/ syntax, though I'm not sure it deals well with
> NTLM domains. You can probably leave CURLOPT_PROXYUSERPWD out if you
> set your proxy url correctly.

Leaving out the line above containing CURLOPT_PROXYUSERPWD in both http.c and transport.c and using curl 7.18.0 ...

$ http_proxy=user-id:password@proxy.domain:<port> GIT_CURL_VERBOSE=1 \
    git fetch http://www.kernel.org/pub/scm/git/git.git

fails proxy NTLM authentication. The correct user-id is used, but maybe the password wasn't correctly parsed.

> As for CURLOPT_PROXYAUTH, it would be better to set it from another
> config.
From a later message:
> Or we should set it to CURLOPT_AUTHANY by default.
The code should probably do both.
Show 12 quoted lines
> > * Connection #0 to host <proxy domain> left intact
> > fatal: Couldn't find remote ref HEAD
> > 
> > So, the proxy communication via NTLM authentication seems 
> > to be working.
> > The patch to transport.c did not change anything as far as 
> > I can see.
> > 
> > The fatal error is from remote.c.  Perhaps, it also requires some
> > changes.
> 
> Does your remote have a HEAD ref ?
The command used to generate the above output is:
$ GIT_CURL_VERBOSE=1 git fetch \
  http://www.kernel.org/pub/scm/git/git.git

I originally tried the following command as suggested by the git home page for getting "git by git".

$ GIT_CURL_VERBOSE=1 git clone \
  http://www.kernel.org/pub/scm/git/git.git
Initialized empty Git repository in /mnt/s2u1/git/test-git/git/.git/
Cannot get remote repository information.
Perhaps git-update-server-info needs to be run there?
$

This seemed like a good test for validating my git installation, but this command doesn't access the proxy at all. The fetch command does. Why the difference?

Thanks,
Ken Fuchs
Mike Hommey· Feb 27, 2008, 22:55 UTC · re: ken.fuchs@bench.com · lore

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

On Wed, Feb 27, 2008 at 04:10:57PM -0600, Ken.Fuchs@bench.com wrote:
Show 18 quoted lines
> The command used to generate the above output is:
> 
> $ GIT_CURL_VERBOSE=1 git fetch \
>   http://www.kernel.org/pub/scm/git/git.git
> 
> I originally tried the following command as suggested by the git
> home page for getting "git by git".
> 
> $ GIT_CURL_VERBOSE=1 git clone \
>   http://www.kernel.org/pub/scm/git/git.git
> Initialized empty Git repository in /mnt/s2u1/git/test-git/git/.git/
> Cannot get remote repository information.
> Perhaps git-update-server-info needs to be run there?
> $
> 
> This seemed like a good test for validating my git installation,
> but this command doesn't access the proxy at all.  The fetch
> command does.  Why the difference?

git-clone is not a builtin yet. When it is (and a patch has come for that), it will correctly use proxys.

Mike

← back to recent threads