{"thread":{"id":"33538","subject":"Git over HTTPS with basic authentication","startedAt":"2013-04-18T19:47:02Z","lastAt":"2013-04-19T15:36:39Z","messageCount":4,"participants":["Sebastian Schmidt","Matthieu Moy","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"214753","messageId":"1366314422.12299.3.camel@sibbo-laptop","threadId":"33538","inReplyTo":null,"subject":"Git over HTTPS with basic authentication","fromName":"Sebastian Schmidt","fromEmail":"isibboi@gmail.com","sentAt":"2013-04-18T19:47:02Z","receivedAt":"2013-04-18T19:47:02Z","isPatch":false,"sender":{"key":"isibboi@gmail.com","avatar":null},"body":"Why is git not working over HTTPS with basic authentication? I can clone\njust fine, but when I try to push, it tells me\n\nerror: Cannot access URL https://..., return code 22\nfatal: git-http-push failed\n\nI have googled for an hour now, all I find is people that have the same\nproblem and the solution is always to use SSH.\n\nSibbo\n"},{"id":"214757","messageId":"vpq8v4f62dj.fsf@grenoble-inp.fr","threadId":"33538","inReplyTo":"1366314422.12299.3.camel@sibbo-laptop","subject":"Re: Git over HTTPS with basic authentication","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-04-18T19:54:32Z","receivedAt":"2013-04-18T19:54:32Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Sebastian Schmidt <isibboi@gmail.com> writes:\n\n> Why is git not working over HTTPS with basic authentication? I can clone\n> just fine, but when I try to push, it tells me\n\nWhat are you using on the server? Dumb HTTP works by serving the\nrepository files as static pages, which is fundamentally read-only. The\nrecommended way is to use smart-HTTP (see man git-http-backend, requires\nGit on the server), and the alternative is to use webdav (much slower).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"214761","messageId":"20130418204320.GA6888@sigill.intra.peff.net","threadId":"33538","inReplyTo":"vpq8v4f62dj.fsf@grenoble-inp.fr","subject":"Re: Git over HTTPS with basic authentication","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-18T20:43:20Z","receivedAt":"2013-04-18T20:43:20Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Apr 18, 2013 at 09:54:32PM +0200, Matthieu Moy wrote:\n\n> Sebastian Schmidt <isibboi@gmail.com> writes:\n> \n> > Why is git not working over HTTPS with basic authentication? I can clone\n> > just fine, but when I try to push, it tells me\n> \n> What are you using on the server? Dumb HTTP works by serving the\n> repository files as static pages, which is fundamentally read-only. The\n> recommended way is to use smart-HTTP (see man git-http-backend, requires\n> Git on the server), and the alternative is to use webdav (much slower).\n\nYeah, this is definitely dumb http (since http-push is involved at all,\nwhich the original error message showed).  Code 22 is curl's \"there was\nan HTTP error\" code, but http-push annoyingly does not output the actual\nHTTP error[1]. You can see more by setting GIT_CURL_VERBOSE=1 in the\nenvironment.\n\nThough if you know you did not set up WebDAV on the server, then we can\nknow that is the problem even without seeing the HTTP code. :)\n\n-Peff\n\n[1] The dumb-http push code is largely unloved and unmaintained at this\n    point. Yet another reason to move to smart http.\n"},{"id":"214832","messageId":"20130419153639.GA14263@sigill.intra.peff.net","threadId":"33538","inReplyTo":"1366361766.3873.4.camel@sibbo-laptop","subject":"Re: Git over HTTPS with basic authentication","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-19T15:36:39Z","receivedAt":"2013-04-19T15:36:39Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Apr 19, 2013 at 10:56:06AM +0200, Sebastian Schmidt wrote:\n\n> I tried switching to smart http now, but have the same error, I guess I\n> did something wrong. It seems like it is getting 401, but I also noticed\n> that info/refs is just an empty file. This is the config of my apache2:\n> \n> SetEnv GIT_PROJECT_ROOT /crypt/git\n> SetEnv GIT_HTTP_EXPORT_ALL\n> ScriptAlias /git/ /usr/lib/git\n\nThis should point to /usr/lib/git/git-http-backend, which I think is the\nsource of your problems.\n\n> <Directory /crypt/git>\n> \tAllow from all\n> \tOrder deny,allow\n> \t\n> \tAuthType Basic\n> \tAuthName \"Git global\"\n> \tAuthUserFile /etc/apache2/auth/passwd\n> \tAuthGroupFile /etc/apache2/auth/groups\n> \t\n> \tRequire group git-shared\n> </Directory>\n\nI'm not sure this <Directory> match will do what you want, because from\nApache's perspective, it is hitting /usr/lib/git/git-http-backend on the\nfilesystem, and it is only git that actually touches the filesystem.\n\nI think you want to use\n\n  <Location /git>\n     ...\n  </Location>\n\ninstead. But I am not an Apache expert, so maybe it does work.\n\n-Peff\n"}]}