On Sun, 5 Jul 2015 06:19:31 -0700 (PDT)
Demi Goldberg <
demi.g...@gmail.com> wrote:
> here is the out put it looks the error is :
> Couldn't find host my_gerrit in the _netrc file; using defaults
To me, this doesn't look like an error and/or the root cause for your
problem: you can read about how libCURL uses ~/.netrc (or
%USERPROFILE%\_netrc on Windows -- hece in Git for Windows) in [1]
and [2] (search for ".netrc" in both places) -- you'll see that this
file is not needed.
On the other hand... do the box on which your push works OK actually
*have* the _netrc file? May be the information in it somehow makes
that other Git instance authenticate OK?
> any idea ?
Well, the only think I don't really understand from the log output you
cited is why the client lists the "nonce" parameter in its debug
printout when only the server sends nonce and the client sends
"cnonce" ("client's nonce").
The Digest HTTP authentication is detailed in RFC 2617 [3], and what I
fail to understand is written below -- inline.
[...]
> > GET /Repo1.git/info/refs?service=git-receive-pack HTTP/1.1
OK, the client sends its request.
[...]
> < HTTP/1.1 401 Unauthorized
> < Date: Sun, 05 Jul 2015 13:02:46 GMT
> < Pragma: no-cache
> * Ignoring duplicate digest auth header.
> < WWW-Authenticate: Digest realm="Gerrit Code Review",
> domain="
http://my_gerrit.sirinmobile.local:8080/", qop="auth",
> nonce="fgxgVG8SwmXKCBXJMkJM1INJ5
> fygcvg5HEqQw==$"
The server sends back 401, tells the client it supports Digest auth,
and tells the client its nonce parameter, which is
"fgxgVG8SwmXKCBXJMkJM1INJ5fygcvg5HEqQw==$".
[...]
> > GET /Repo1.git/info/refs?service=git-receive-pack HTTP/1.1
The client re-tries its request, attaching its authentication response:
> Authorization: Digest
> username="my_user",realm="",nonce="6HqKHPlkKDGcJ9W6heFSPRarWXXOM7pwXtb
> +Qw==$",uri="/Repo1.git/info/refs?service=git-receive-pack"
> cnonce="7a0ec2f906d588f7ceb78266092e80b4",
> nc=00000001,response="d1251c92d0450b1218b95418f38b9a08",qop="auth"
What I don't get about this is why there's this "nonce" parameter
and why it's different from the server's.
[...]
> < HTTP/1.1 403 Forbidden
The server forbids our request.
TL;DR
I'm not an expert on RFC 2617, and Digets auth is of the
challenge-response type so one can't just decode it and see whether the
client's credentials has been sent correctly -- simply because they are
not sent over the wire as the client merely proves it knows the
correct passphrase.
I don't know where to go from there to be honest.
If possible, I'd start with looking at the logs on the Gerrit's side.
Also trying direct curl call may be
[...]
1.
http://curl.haxx.se/docs/manual.html
2.
http://curl.haxx.se/docs/manpage.html
3.
http://tools.ietf.org/html/rfc2617