{"thread":{"id":"21375","subject":"From 200 to 404 to 407.","startedAt":"2009-10-27T10:18:44Z","lastAt":"2009-10-28T16:48:47Z","messageCount":8,"participants":["Peter Odéus","Avery Pennarun","Peter"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"126002","messageId":"82fd2c5d0910270318wc30bc44tfd3362933d3f62cf@mail.gmail.com","threadId":"21375","inReplyTo":null,"subject":"From 200 to 404 to 407.","fromName":"Peter Odéus","fromEmail":"peter.odeus@gmail.com","sentAt":"2009-10-27T10:18:44Z","receivedAt":"2009-10-27T10:18:44Z","isPatch":false,"sender":{"key":"peter.odeus@gmail.com","avatar":null},"body":"Hi,\n\nDoing a \"git clone...\" using authenticated proxy (set in $http_proxy):\n\nUpon initial success (HTTP 200) and receiving a single HTTP 404 (not\nfound), every GET after that renders a HTTP 407 (Proxy authentication\nrequired).\n\ncurl -I \"url_giving_http_407\" comes out just fine as a HTTP 200.\n\nBug or just me?\n"},{"id":"126038","messageId":"32541b130910270953w6bd35ddctd471e682830b8f62@mail.gmail.com","threadId":"21375","inReplyTo":"82fd2c5d0910270318wc30bc44tfd3362933d3f62cf@mail.gmail.com","subject":"Re: From 200 to 404 to 407.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-10-27T16:53:39Z","receivedAt":"2009-10-27T16:53:39Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Tue, Oct 27, 2009 at 6:18 AM, Peter Odéus <peter.odeus@gmail.com> wrote:\n> Doing a \"git clone...\" using authenticated proxy (set in $http_proxy):\n>\n> Upon initial success (HTTP 200) and receiving a single HTTP 404 (not\n> found), every GET after that renders a HTTP 407 (Proxy authentication\n> required).\n>\n> curl -I \"url_giving_http_407\" comes out just fine as a HTTP 200.\n\nThe easiest way to track this down is to log it using ethereal, and\ncompare the http session dumps.  There may be differences in headers\nor something that git is providing vs. the command-line curl.\n\nIf you don't know how to analyze http dumps, then just log them to a\nfile using tcpdump's -w option and email them to me, and I'll take a\nlook.  (I probably won't fix the bug in git, but I can at least tell\nyou what/if the bug is :))  Please don't send the binary dumpfiles to\nthe mailing list, though.\n\nHave fun,\n\nAvery\n"},{"id":"126148","messageId":"loom.20091028T160202-594@post.gmane.org","threadId":"21375","inReplyTo":"32541b130910270953w6bd35ddctd471e682830b8f62@mail.gmail.com","subject":"Re: From 200 to 404 to 407.","fromName":"Peter","fromEmail":"peter.odeus@gmail.com","sentAt":"2009-10-28T15:02:43Z","receivedAt":"2009-10-28T15:02:43Z","isPatch":false,"sender":{"key":"peter.odeus@gmail.com","avatar":null},"body":"\n\nDon't have root access at work == no wireshark.\n"},{"id":"126152","messageId":"loom.20091028T162635-811@post.gmane.org","threadId":"21375","inReplyTo":"loom.20091028T160202-594@post.gmane.org","subject":"Re: From 200 to 404 to 407.","fromName":"Peter Odéus","fromEmail":"peter.odeus@gmail.com","sentAt":"2009-10-28T15:35:48Z","receivedAt":"2009-10-28T15:35:48Z","isPatch":false,"sender":{"key":"peter.odeus@gmail.com","avatar":null},"body":"Peter <peter.odeus <at> gmail.com> writes:\n\n> \n> \n> Don't have root access at work == no wireshark.\n> \n> \n\nI have tried to attach rich console output (thanks to env variable \nGIT_CURL_VERBOSE=1) into a gmane-follow-up-message.\n\nNo dice. \n\nAre there restrictions on what characters are permitted?  \n"},{"id":"126155","messageId":"32541b130910280850t5b4baa91p90b31b4c1c467e94@mail.gmail.com","threadId":"21375","inReplyTo":"82fd2c5d0910280138r52baff98p3f4ff65e968b0d37@mail.gmail.com","subject":"Re: From 200 to 404 to 407.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-10-28T15:50:21Z","receivedAt":"2009-10-28T15:50:21Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Wed, Oct 28, 2009 at 4:38 AM, Peter Odéus <peter.odeus@gmail.com> wrote:\n> * Re-using existing connection! (#0) with host proxyserver.acme.com\n> * Connected to proxyserver.acme.com (192.71.145.9) port 8080\n> > GET http://gitrepo.outside.com/git/gitrepo.git/objects/6b/132a9e81161e58812902d7f735a38bf5ee1583 HTTP/1.1\n> Proxy-Authorization: Basic cmQva3F3Zzc2MjptYW1tYW1pYQ==\n> User-Agent: git/1.6.5.2\n> Host: gitrepo.outside.com\n> Accept: */*\n>\n> * The requested URL returned error: 404\n\nSo this git object didn't exist, apparently.  Can you confirm that the\nobject shouldn't be there?  (on the server: git cat-file -p\n6b132a9e81161e58812902d7f735a38bf5ee1583)  Does git-fsck report\nanything weird on the server repository?\n\n> * Closing connection #0\n> * Couldn't find host gitrepo.outside.com in the .netrc file, using defaults\n> * About to connect() to proxyserver.acme.com port 8080\n> *   Trying 192.71.145.9... * connected\n> * Connected to proxyserver.acme.com (192.71.145.9) port 8080\n> > GET http://gitrepo.outside.com/git/gitrepo.git/objects/info/http-alternates HTTP/1.1\n> User-Agent: git/1.6.5.2\n> Host: gitrepo.outside.com\n> Accept: */*\n> Pragma: no-cache\n>\n> < HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires\n> authorization to fulfill the request. Access to the Web Proxy service\n> is denied.  )\n\nThis error seems to happen because the Proxy-Authorization line was\nnot included in this request like it was included in prior ones.\nProbably the authorization key was forgotten when the first connection\nclosed.  If there hadn't been a 404, the connection wouldn't have\nclosed and this wouldn't have happened, which is presumably why you\nhaven't seen this problem before.\n\nThis is where my expertise ends, since I've never messed with either\nlibcurl or git's usage of it.  I couldn't tell you if this is a\nlibcurl bug or a git bug.  (Proxies are relatively rare nowadays, so\nthis code path is likely to be rarely tested.)\n\nHopefully someone else on the list can assist.\n\n** WARNING: the username/password sent in the Proxy-Authorization line\nis not encrypted and you've posted a trace of it to a public mailing\nlist.  You need to change your password immediately. **\n\nGood luck,\n\nAvery\n"},{"id":"126157","messageId":"loom.20091028T170227-957@post.gmane.org","threadId":"21375","inReplyTo":"32541b130910280850t5b4baa91p90b31b4c1c467e94@mail.gmail.com","subject":"Re: From 200 to 404 to 407.","fromName":"Peter Odéus","fromEmail":"peter.odeus@gmail.com","sentAt":"2009-10-28T16:10:42Z","receivedAt":"2009-10-28T16:10:42Z","isPatch":false,"sender":{"key":"peter.odeus@gmail.com","avatar":null},"body":"Avery Pennarun <apenwarr <at> gmail.com> writes:\n\n> \n> On Wed, Oct 28, 2009 at 4:38 AM, Peter Odéus <peter.odeus <at> gmail.com> \nwrote:\n> > * Re-using existing connection! (#0) with host proxyserver.acme.com\n> > * Connected to proxyserver.acme.com (192.71.145.9) port 8080\n> > > GET\n> \nhttp://gitrepo.outside.com/git/gitrepo.git/objects/6b/132a9e81161e58812902d7f735\na38bf5ee1583 HTTP/1.1\n> > Proxy-Authorization: Basic cmQva3F3Zzc2MjptYW1tYW1pYQ==\n> > User-Agent: git/1.6.5.2\n> > Host: gitrepo.outside.com\n> > Accept: */*\n> >\n> > * The requested URL returned error: 404\n> \n> So this git object didn't exist, apparently.  Can you confirm that the\n> object shouldn't be there?  (on the server: git cat-file -p\n> 6b132a9e81161e58812902d7f735a38bf5ee1583)  Does git-fsck report\n> anything weird on the server repository?\n> \n> > * Closing connection #0\n> > * Couldn't find host gitrepo.outside.com in the .netrc file, using defaults\n> > * About to connect() to proxyserver.acme.com port 8080\n> > *   Trying 192.71.145.9... * connected\n> > * Connected to proxyserver.acme.com (192.71.145.9) port 8080\n> > > GET http://gitrepo.outside.com/git/gitrepo.git/objects/info/http-\nalternates HTTP/1.1\n> > User-Agent: git/1.6.5.2\n> > Host: gitrepo.outside.com\n> > Accept: */*\n> > Pragma: no-cache\n> >\n> > < HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires\n> > authorization to fulfill the request. Access to the Web Proxy service\n> > is denied.  )\n> \n> This error seems to happen because the Proxy-Authorization line was\n> not included in this request like it was included in prior ones.\n> Probably the authorization key was forgotten when the first connection\n> closed.  If there hadn't been a 404, the connection wouldn't have\n> closed and this wouldn't have happened, which is presumably why you\n> haven't seen this problem before.\n> \n> This is where my expertise ends, since I've never messed with either\n> libcurl or git's usage of it.  I couldn't tell you if this is a\n> libcurl bug or a git bug.  (Proxies are relatively rare nowadays, so\n> this code path is likely to be rarely tested.)\n> \n> Hopefully someone else on the list can assist.\n> \n> ** WARNING: the username/password sent in the Proxy-Authorization line\n> is not encrypted and you've posted a trace of it to a public mailing\n> list.  You need to change your password immediately. **\n> \n> Good luck,\n> \n> Avery\n> \n\nIf you wouldn't have posted the base64-encoded password it would have never hit \nthe gmane list ;-) \n\nDon't worry about it, because I tried to submit the console output myself all \nday. But to no avail.\n\nIs it enough to replace greater-than-signs to something else, btw?\n\nAnyway. Behind these corporate walls, the proxy is a reality to deal with, so \nhopefully someone else can bring us closer to a solutiuon.\n\nThanks for your input.\n\n:D\n\n/Peter \n"},{"id":"126158","messageId":"32541b130910280935l5321c157x68c1cf007a476b39@mail.gmail.com","threadId":"21375","inReplyTo":"loom.20091028T170227-957@post.gmane.org","subject":"Re: From 200 to 404 to 407.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-10-28T16:35:39Z","receivedAt":"2009-10-28T16:35:39Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Wed, Oct 28, 2009 at 12:10 PM, Peter Odéus <peter.odeus@gmail.com> wrote:\n> Avery Pennarun <apenwarr <at> gmail.com> writes:\n> If you wouldn't have posted the base64-encoded password it would have never hit\n> the gmane list ;-)\n\nSorry about that.  The To: line indicated that the message had been\nsent to the list, so I didn't realize that your copy was rejected.  I\nhave no idea what made gmane reject it for you (or whether my own copy\nwas rejected, for that matter :)).\n\nAvery\n"},{"id":"126159","messageId":"32541b130910280948u57535c2bnbc30424b7ef13e2a@mail.gmail.com","threadId":"21375","inReplyTo":"loom.20091028T170227-957@post.gmane.org","subject":"Re: From 200 to 404 to 407.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-10-28T16:48:47Z","receivedAt":"2009-10-28T16:48:47Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Wed, Oct 28, 2009 at 12:10 PM, Peter Odéus <peter.odeus@gmail.com> wrote:\n> Anyway. Behind these corporate walls, the proxy is a reality to deal with, so\n> hopefully someone else can bring us closer to a solutiuon.\n\nI was just looking at the source and it seems all the curl-related\nstuff is isolated in git/http.c, and is pretty easy to understand.\nSince I have no way to reproduce your problem, I won't attempt to look\ninto it myself.  But if you look for \"proxy\" (and especially\nCURLOPT_PROXY) in that file, you might find something.\n\nSpecifically, I would suggest resetting the CURLOPT_PROXY setting\nbefore each URL request (eg. in new_http_object_request).\n\nHope this helps.\n\nAvery\n"}]}