title: git-http-backend and ldap authentication, push error: requested URL returned error: 401 Authorization Required
body: <p><br>
  My setup:</p>
  
  <p>OS: debian <br>
  git v 1.7.10<br>
  apache (with suexec mode enabled) configuration with git-http-backend and ldap authorization to git repos wchich works for clone operations, but not working for push and that's the problem. I use https as communication protocol to my git server.<br>Here's my config:<br></p>
  
  <p><strong>VirtualHost config:</strong></p>
  
  <pre><code>&lt;IfModule mod_ssl.c&gt;
  &lt;VirtualHost _default_:443&gt;
  
      DocumentRoot /git/myrepos
  
      &lt;Directory "/git/myrepos"&gt;
      Allow from All
      Options +ExecCGI
      AllowOverride All
      &lt;/Directory&gt;
  
  ScriptAlias /git /git/myrepos/bin/suexec-wrapper.sh
  SSLEngine on
  SSLCertificateFile    /etc/ssl/git.crt
  SSLCertificateKeyFile /etc/ssl/git.key
  
  &lt;FilesMatch "\.(cgi|shtml|phtml|php)$"&gt;
          SSLOptions +StdEnvVars
      &lt;/FilesMatch&gt;
      &lt;Directory /usr/lib/cgi-bin&gt;
          SSLOptions +StdEnvVars
      &lt;/Directory&gt;
  </code></pre>
  
  <p><br><strong>/git/myrepos/bin/suexec-wrapper.sh:</strong></p>
  
  <pre><code>#!/bin/bash
  PATH_INFO=$SCRIPT_URL
  GIT_PROJECT_ROOT=/git/myrepos
  REMOTE_USER=$REDIRECT_REMOTE_USER
  export GIT_HTTP_EXPORT_ALL=true
  /usr/lib/git-core/git-http-backend
  </code></pre>
  
  <p><br>Cloning repos works as it should (eg. <code>git clone https://192.168.0.1/repo1.git</code>): it accepts credentials for ldap user and clone the repo.<br>
  And when pushing repo (eg. git push origin master): it asks for credentials, accept them and then throws error:<br></p>
  
  <pre><code>error: Cannot access URL https://192.168.0.1/repo1.git/, return code 22
  fatal: git-http-push failed
  </code></pre>
  
  <p><br>When running push in verbose mode (<code>GIT_CURL_VERBOSE=1 git push origin master</code>) it asks for credentials, accept them and (tail of output):<br></p>
  
  <pre><code>* STATE: DO =&gt; DO_DONE handle 0x1cdd270; (connection #0)
  * STATE: DO_DONE =&gt; WAITPERFORM handle 0x1cdd270; (connection #0)
  * STATE: WAITPERFORM =&gt; PERFORM handle 0x1cdd270; (connection #0)
  * additional stuff not fine transfer.c:1037: 0 0
  * The requested URL returned error: 401
  * Closing connection #0
  * Expire cleared
  error: Cannot access URL https://192.168.0.1/repo1.git/, return code 22
  fatal: git-http-push failed
  </code></pre>
  
  <p>Am I configuring apache git-http-backend (with wrap script?) properly?<br>
  And what can cause the problem with push operation?<br>
  How to debug it more detailed way?<br>
  Any suggestions very appreciated!<br>
  Kind regards</p>