{"thread":{"id":"32081","subject":"RE: Failure using webdav basic auth by git client","startedAt":"2012-11-11T18:09:02Z","lastAt":"2012-11-12T12:27:13Z","messageCount":3,"participants":["Jason Pyeron","Jeff King","Pyeron, Jason J CTR (US)"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"202906","messageId":"121F1C4AA6A845229D3DF5808B4F0F9E@black","threadId":"32081","inReplyTo":null,"subject":"RE: Failure using webdav basic auth by git client","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2012-11-11T18:09:02Z","receivedAt":"2012-11-11T18:09:02Z","isPatch":false,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"I had to munge the body so the list would post it.\n\nSee: http://vger.kernel.org/majordomo-taboos.txt\n\n\n\n> -----Original Message-----\n> From: Pyeron, Jason J CTR (US)\n> Sent: Thursday, November 08, 2012 2:49 PM\n> To: git@vger.kernel.org\n> Subject: Failure using webdav basic auth by git client\n> \n> My google fu has failed me on this issue. I am trying to setup http(s)\n> repositories for git. If I require authenticated users then git asks\n> for a username and password for the first volley of communications, but\n> then does not include the Authorization header on subsequent requests.\n> \n> Below is the log if I enable username and password BASIC auth in\n> Apache.\n> \n> user@host /tmp/foo/test\n> $ git push origin master\n> trace: built-in: git 'push' 'origin' 'master'\n> trace: run_command: 'git-remote-http' 'origin'\n> 'http://server/git/test/'\n> * Couldn't find host server in the .netrc file; using defaults\n> * About to connect() to server port 80 (#0)\n> *   Trying server...\n> * 0x800766e8 is at send pipe head!\n> * STATE: CONNECT => WAITCONNECT handle 0x8007f040; (connection #0)\n> * Connected to server (server) port 80 (#0)\n> * Connected to server (server) port 80 (#0)\n> * STATE: WAITCONNECT => DO handle 0x8007f040; (connection #0)\n> > GET /git/test/info/refs?service=git-receive-pack HTTP/1.1\n> User-Agent: git/1.7.9\n> Host: server\n> Accept: */*\n> Pragma: no-cache\n> \n> * STATE: DO => DO_DONE handle 0x8007f040; (connection #0)\n> * STATE: DO_DONE => WAITPERFORM handle 0x8007f040; (connection #0)\n> * STATE: WAITPERFORM => PERFORM handle 0x8007f040; (connection #0)\n> * additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-\n> 7.27.0/lib/transfer.c:1037: 0 0\n> * The requested URL returned error: 401 Authorization Required\n> * Closing connection #0\n> Username for 'http://server':\n> Password for 'http://test@server':\n> * Couldn't find host server in the .netrc file; using defaults\n> * About to connect() to server port 80 (#0)\n> *   Trying server...\n> * 0x800766e8 is at send pipe head!\n> * STATE: CONNECT => WAITCONNECT handle 0x8007f9c0; (connection #0)\n> * Connected to server (server) port 80 (#0)\n> * Connected to server (server) port 80 (#0)\n> * STATE: WAITCONNECT => DO handle 0x8007f9c0; (connection #0)\n> > GET /git/test/info/refs?service=git-receive-pack HTTP/1.1\n> User-Agent: git/1.7.9\n> Host: server\n> Accept: */*\n> Pragma: no-cache\n> \n> * STATE: DO => DO_DONE handle 0x8007f9c0; (connection #0)\n> * STATE: DO_DONE => WAITPERFORM handle 0x8007f9c0; (connection #0)\n> * STATE: WAITPERFORM => PERFORM handle 0x8007f9c0; (connection #0)\n> * additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-\n> 7.27.0/lib/transfer.c:1037: 0 0\n> * HTTP 1.1 or later with persistent connection, pipelining supported\n> < HTTP/1.1 401 Authorization Required\n> < Date: Fri, 02 Nov 2012 03:11:53 GMT\n> < Server: Apache/2.0.52 (CentOS)\n> < WWW-Authenticate: Basic realm=\"Git\"\n> < Content-Length: 479\n> < Connection: close\n> < C-o-n-t-e-n-t---T-y-p-e-:- -t-e-x-t-/-h-t-m-l-;-\n-c-h-a-r-s-e-t-=-i-s-o---8-8-5-9---1-\n> <\n> * Closing connection #0\n> * Issue another request to this URL:\n> 'http://server/git/test/info/refs?service=git-receive-pack'\n> * Couldn't find host server in the .netrc file; using defaults\n> * About to connect() to server port 80 (#0)\n> *   Trying server...\n> * 0x800766e8 is at send pipe head!\n> * STATE: CONNECT => WAITCONNECT handle 0x8007f9c0; (connection #0)\n> * Connected to server (server) port 80 (#0)\n> * Connected to server (server) port 80 (#0)\n> * STATE: WAITCONNECT => DO handle 0x8007f9c0; (connection #0)\n> * Server auth using Basic with user 'test'\n> > GET /git/test/info/refs?service=git-receive-pack HTTP/1.1\n> Authorization: Basic dGVzdDpwYXNzd29yZA==\n> User-Agent: git/1.7.9\n> Host: server\n> Accept: */*\n> Pragma: no-cache\n> \n> * STATE: DO => DO_DONE handle 0x8007f9c0; (connection #0)\n> * STATE: DO_DONE => WAITPERFORM handle 0x8007f9c0; (connection #0)\n> * STATE: WAITPERFORM => PERFORM handle 0x8007f9c0; (connection #0)\n> * additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-\n> 7.27.0/lib/transfer.c:1037: 0 0\n> * HTTP 1.1 or later with persistent connection, pipelining supported\n> < HTTP/1.1 200 OK\n> < Date: Fri, 02 Nov 2012 03:11:53 GMT\n> < Server: Apache/2.0.52 (CentOS)\n> < Last-Modified: Thu, 01 Nov 2012 01:32:28 GMT\n> < ETag: \"714064-0-fdf5a300\"\n> < Accept-Ranges: bytes\n> < Content-Length: 0\n> < Connection: close\n> < Content-Type: text/plain; charset=UTF-8\n> <\n> * STATE: PERFORM => DONE handle 0x8007f9c0; (connection #0)\n> * Closing connection #0\n> * Couldn't find host server in the .netrc file; using defaults\n> * About to connect() to server port 80 (#0)\n> *   Trying server...\n> * 0x800766e8 is at send pipe head!\n> * STATE: CONNECT => WAITCONNECT handle 0x80076678; (connection #0)\n> * Connected to server (server) port 80 (#0)\n> * Connected to server (server) port 80 (#0)\n> * STATE: WAITCONNECT => DO handle 0x80076678; (connection #0)\n> * Server auth using Basic with user 'test'\n> > GET /git/test/HEAD HTTP/1.1\n> Authorization: Basic dGVzdDpwYXNzd29yZA==\n> User-Agent: git/1.7.9\n> Host: server\n> Accept: */*\n> Pragma: no-cache\n> \n> * STATE: DO => DO_DONE handle 0x80076678; (connection #0)\n> * STATE: DO_DONE => WAITPERFORM handle 0x80076678; (connection #0)\n> * STATE: WAITPERFORM => PERFORM handle 0x80076678; (connection #0)\n> * additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-\n> 7.27.0/lib/transfer.c:1037: 0 0\n> * additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-\n> 7.27.0/lib/transfer.c:1037: 0 0\n> * HTTP 1.1 or later with persistent connection, pipelining supported\n> < HTTP/1.1 200 OK\n> < Date: Fri, 02 Nov 2012 03:11:53 GMT\n> < Server: Apache/2.0.52 (CentOS)\n> < Last-Modified: Thu, 01 Nov 2012 01:23:43 GMT\n> < ETag: \"704053-17-deaac5c0\"\n> < Accept-Ranges: bytes\n> < Content-Length: 23\n> < Connection: close\n> < Content-Type: text/plain; charset=UTF-8\n> <\n> * STATE: PERFORM => DONE handle 0x80076678; (connection #0)\n> * Closing connection #0\n> trace: run_command: 'http-push' '--helper-status'\n> 'http://server/git/test/' 'refs/heads/master:refs/heads/master'\n> trace: exec: 'git' 'http-push' '--helper-status'\n> 'http://server/git/test/' 'refs/heads/master:refs/heads/master'\n> trace: exec: 'git-http-push' '--helper-status'\n> 'http://server/git/test/' 'refs/heads/master:refs/heads/master'\n> trace: run_command: 'git-http-push' '--helper-status'\n> 'http://server/git/test/' 'refs/heads/master:refs/heads/master'\n> * Couldn't find host server in the .netrc file; using defaults\n> * About to connect() to server port 80 (#0)\n> *   Trying server...\n> * 0x8006f558 is at send pipe head!\n> * STATE: CONNECT => WAITCONNECT handle 0x80077e58; (connection #0)\n> * Connected to server (server) port 80 (#0)\n> * Connected to server (server) port 80 (#0)\n> * STATE: WAITCONNECT => DO handle 0x80077e58; (connection #0)\n> > PROPFIND /git/test/ HTTP/1.1\n> User-Agent: git/1.7.9\n> Host: server\n> Accept: */*\n> Depth: 0\n> Content-Type: text/xml\n> Content-Length: 159\n> Expect: 100-continue\n> \n> * STATE: DO => DO_DONE handle 0x80077e58; (connection #0)\n> * STATE: DO_DONE => WAITPERFORM handle 0x80077e58; (connection #0)\n> * STATE: WAITPERFORM => PERFORM handle 0x80077e58; (connection #0)\n> * additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-\n> 7.27.0/lib/transfer.c:1037: 0 0\n> * HTTP 1.1 or later with persistent connection, pipelining supported\n> < HTTP/1.1 100 Continue\n> * additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-\n> 7.27.0/lib/transfer.c:1037: 0 0\n> * We are completely uploaded and fine\n> * The requested URL returned error: 401 Authorization Required\n> * Closing connection #0\n> * Expire cleared\n> error: Cannot access URL http://server/git/test/, return code 22\n> fatal: git-http-push failed\n> \n> \n> Disabling the auth requirement gives in the apache config, I have the\n> full trace (quite long) available for the below upon request:\n> \n> user@host /tmp/foo/test\n> $ git push origin master\n> To http://server/git/test/\n>  * [new branch]      master -> master\n"},{"id":"202912","messageId":"20121111182842.GC21654@sigill.intra.peff.net","threadId":"32081","inReplyTo":"121F1C4AA6A845229D3DF5808B4F0F9E@black","subject":"Re: Failure using webdav basic auth by git client","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-11-11T18:28:42Z","receivedAt":"2012-11-11T18:28:42Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Nov 11, 2012 at 01:09:02PM -0500, Jason Pyeron wrote:\n\n> > My google fu has failed me on this issue. I am trying to setup http(s)\n> > repositories for git. If I require authenticated users then git asks\n> > for a username and password for the first volley of communications, but\n> > then does not include the Authorization header on subsequent requests.\n> [...]\n> > > GET /git/test/info/refs?service=git-receive-pack HTTP/1.1\n> > User-Agent: git/1.7.9\n\nCan you try with a more recent git version? There were some bugs with\non-demand http auth when using the dumb protocol (which I see you are\nusing). They were fixed in v1.7.10.2 and higher.\n\nAlso, consider setting up the smart-http protocol, as it is way more\nefficient.\n\n-Peff\n"},{"id":"202951","messageId":"871B6C10EBEFE342A772D1159D13208537AA3BFD@umechphj.easf.csd.disa.mil","threadId":"32081","inReplyTo":"20121111182842.GC21654@sigill.intra.peff.net","subject":"RE: Failure using webdav basic auth by git client","fromName":"Pyeron, Jason J CTR (US)","fromEmail":"jason.j.pyeron.ctr@mail.mil","sentAt":"2012-11-12T12:27:13Z","receivedAt":"2012-11-12T12:27:13Z","isPatch":false,"sender":{"key":"jason.j.pyeron.ctr@mail.mil","avatar":null},"body":"> -----Original Message-----\n> From: Jeff King \n> Sent: Sunday, November 11, 2012 1:29 PM\n> \n> On Sun, Nov 11, 2012 at 01:09:02PM -0500, Jason Pyeron wrote:\n> \n> > > My google fu has failed me on this issue. I am trying to setup\n> http(s)\n> > > repositories for git. If I require authenticated users then git\n> asks\n> > > for a username and password for the first volley of communications,\n> but\n> > > then does not include the Authorization header on subsequent\n> requests.\n> > [...]\n> > > > GET /git/test/info/refs?service=git-receive-pack HTTP/1.1\n> > > User-Agent: git/1.7.9\n> \n> Can you try with a more recent git version? There were some bugs with\n> on-demand http auth when using the dumb protocol (which I see you are\n> using). They were fixed in v1.7.10.2 and higher.\n\nHaving some troubles compiling the maint branch on cygwin (same issue for master).\n\n\n> \n> Also, consider setting up the smart-http protocol, as it is way more\n> efficient.\n\nWill look into that after I get git compiling...\n\n"}]}