{"thread":{"id":"26161","subject":"HTTP push not respecting .netrc","startedAt":"2010-12-30T06:56:28Z","lastAt":"2011-01-27T02:47:56Z","messageCount":5,"participants":["David Borowitz","Tay Ray Chuan","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"158750","messageId":"AANLkTik84-zRwi+0dGGFoTUrj6Zr3bxO=fE9P_3MuZdZ@mail.gmail.com","threadId":"26161","inReplyTo":null,"subject":"HTTP push not respecting .netrc","fromName":"David Borowitz","fromEmail":"dave@bwitz.com","sentAt":"2010-12-30T06:56:28Z","receivedAt":"2010-12-30T06:56:28Z","isPatch":false,"sender":{"key":"dave@bwitz.com","avatar":null},"body":"Hi all,\n\nI'm trying to push to a smart HTTP remote using the following command line:\nhttp_proxy=localhost:4242 git push -v http://xxxxx:25989/git/foo\n+refs/heads/*:refs/heads/*\n(The weird proxy and port are not under my control.)\n\nThe webserver should return 401 for unauthorized access, and indeed it does:\nerror: RPC failed; result=65, HTTP code = 401\n(The rest of the error text from git push is not particularly useful,\nbut I'm not worried about that at the moment.)\n\nMaking a request manually with curl --netrc shows that the auth header\nis being sent[1]. But sniffing the HTTP traffic from git shows that\nthe auth header is not sent[2].\n\nI also tried various other things like aliasing xxxxx to 127.0.0.1 and\nremoving the proxy and port number, and specifying user@xxxxx in the\nURL, and nothing I've done makes git send the necessary auth header.\n(In the last case it does prompt for a password.)\n\nAnyone have any other ideas? I could swear this was working a few\nweeks ago, so I must be missing something simple.\n\n[1]\n$ http_proxy=localhost:4242 curl -vvn\nhttp://xxxxx:25989/git/foo/info/refs?service=git-receive-pack\n* About to connect() to proxy localhost port 4242 (#0)\n*   Trying ::1... Connection refused\n*   Trying 127.0.0.1... connected\n* Connected to localhost (127.0.0.1) port 4242 (#0)\n* Server auth using Basic with user 'yyyyy'         <----\n> GET http://xxxxx:25989/git/foo/info/refs?service=git-receive-pack HTTP/1.1\n> Authorization: Basic zzzzzzzz          <----\n> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15\n> Host: xxxxx:25989\n> Accept: */*\n> Proxy-Connection: Keep-Alive\n>\n< HTTP/1.1 200 OK\n...\n\n\n[2]\nGET http://xxxxx:25989/git/foo/info/refs?service=git-receive-pack HTTP/1.1\nUser-Agent: git/1.7.4.rc0\nHost: xxxxx:25989\nAccept: */*\nProxy-Connection: Keep-Alive\nPragma: no-cache\n"},{"id":"158776","messageId":"AANLkTi=4cE711TtqE0E-05s9Pk72C8OymNf_-5NhrfXS@mail.gmail.com","threadId":"26161","inReplyTo":"AANLkTik84-zRwi+0dGGFoTUrj6Zr3bxO=fE9P_3MuZdZ@mail.gmail.com","subject":"Re: HTTP push not respecting .netrc","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-12-31T04:03:24Z","receivedAt":"2010-12-31T04:03:24Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"On Thu, Dec 30, 2010 at 2:56 PM, David Borowitz <dave@bwitz.com> wrote:\n> I'm trying to push to a smart HTTP remote using the following command line:\n> http_proxy=localhost:4242 git push -v http://xxxxx:25989/git/foo\n> +refs/heads/*:refs/heads/*\n> (The weird proxy and port are not under my control.)\n>\n> The webserver should return 401 for unauthorized access, and indeed it does:\n> error: RPC failed; result=65, HTTP code = 401\n> (The rest of the error text from git push is not particularly useful,\n> but I'm not worried about that at the moment.)\n\nCould you run the push with the environment variable GIT_CURL_VERBOSE=1?\n\n> [2]\n> GET http://xxxxx:25989/git/foo/info/refs?service=git-receive-pack HTTP/1.1\n> User-Agent: git/1.7.4.rc0\n> Host: xxxxx:25989\n> Accept: */*\n> Proxy-Connection: Keep-Alive\n> Pragma: no-cache\n\nTry having a entry for xxxxx:25989 in your .netrc - that should be\nsufficient to demonstrate to you that git+curl reads your .netrc.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"159416","messageId":"7vy66p1vn3.fsf@alter.siamese.dyndns.org","threadId":"26161","inReplyTo":"AANLkTi=4cE711TtqE0E-05s9Pk72C8OymNf_-5NhrfXS@mail.gmail.com","subject":"Re: HTTP push not respecting .netrc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-13T00:42:56Z","receivedAt":"2011-01-13T00:42:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Has this been resolved to satisfaction?  Just being curious...\n"},{"id":"159417","messageId":"AANLkTik4v3Gf48RtqQtqNt5ocdCuqSZqPpBzx4RifyEp@mail.gmail.com","threadId":"26161","inReplyTo":"7vy66p1vn3.fsf@alter.siamese.dyndns.org","subject":"Re: HTTP push not respecting .netrc","fromName":"David Borowitz","fromEmail":"dave@bwitz.com","sentAt":"2011-01-13T00:48:12Z","receivedAt":"2011-01-13T00:48:12Z","isPatch":false,"sender":{"key":"dave@bwitz.com","avatar":null},"body":"On Wed, Jan 12, 2011 at 16:42, Junio C Hamano <gitster@pobox.com> wrote:\n> Has this been resolved to satisfaction?  Just being curious...\n\nI went on vacation, came back, and it magically worked (or maybe I\ntyped something else); you know how these things can be. I'll\ndefinitely use those tips and respond on this thread if it happens\nagain.\n"},{"id":"159939","messageId":"AANLkTi=k5m+90wZPLMjah3cnL=4PjF5Skp2zkaTXyD09@mail.gmail.com","threadId":"26161","inReplyTo":"AANLkTi=cqsvXb3eywTfxAg9hH9cigumSQjoHqq5bnJfM@mail.gmail.com","subject":"Re: HTTP push not respecting .netrc","fromName":"David Borowitz","fromEmail":"dave@bwitz.com","sentAt":"2011-01-27T02:47:56Z","receivedAt":"2011-01-27T02:47:56Z","isPatch":false,"sender":{"key":"dave@bwitz.com","avatar":null},"body":"On Wed, Jan 26, 2011 at 18:00, David Borowitz <dave@bwitz.com> wrote:\n> But this raises further questions:\n> -Why does git/curl decide it's ok to retry with authentication in one\n> case, but not in the other?\n\nPoking further, it looks like curl is deciding not to retry because\nthe ioctl callback is failing to rewind the post buffer when clearly\nit should be able to. So it's more likely a git bug than a curl issue\n(the following question notwithstanding).\n\n> -Why does curl send the auth header before ever receiving a 401, while\n> git does not? (Would fixing this be as easy as setting another curl\n> option?)\n"}]}