# How to push to http(s) repository with authentication?

4 messages from 2008-10-20 to 2008-10-23. Participants: Josef Wolf, Alex Riesen.
Thread: https://gitlist.dev/t/15985

## Josef Wolf, 2008-10-20 18:25

Subject: How to push to http(s) repository with authentication?
Message-ID: <20081020182502.GH9707@raven.wolf.lan>
URL: https://gitlist.dev/e/20081020182502.GH9707%40raven.wolf.lan

```
Hello,

I have set up a repository as described in

  http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt

over SSL with basic authentication.  DAV access works fine with konqueror,
cadaver and and curl, using this .curlrc:

   $ cat ~/.curlrc
   --cacert /etc/cacerts/myca.pem
   --user   user
   $ curl https://repo.host.org/git/test/HEAD
   Enter host password for user 'user':
   ref: refs/heads/master
   $

But when called from git, this file seems to be ignored.  I have checked
google, but the only hint I could find was to put credentials into
~/.netrc.  IMHO, this is a bad workaround, since this implies to have
unencrypted passwords lying around on the disk.

Any hints?

PS: I have asked a similar question a couple of days ago.  Here is a link
    to my original mail with more information how I set up the server:

      http://marc.info/?l=git&m=122426078301793&w=2

```

## Josef Wolf, 2008-10-23 17:53

Subject: Re: How to push to http(s) repository with authentication?
Message-ID: <20081023175336.GA3526@raven.wolf.lan>
URL: https://gitlist.dev/e/20081023175336.GA3526%40raven.wolf.lan
In-Reply-To: <20081020182502.GH9707@raven.wolf.lan>

```
On Mon, Oct 20, 2008 at 08:25:02PM +0200, Josef Wolf wrote:

> I have set up a repository as described in
> 
>   http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt
> 
> over SSL with basic authentication.  DAV access works fine with konqueror,
> cadaver and and curl, using this .curlrc:
> [ ... ]

Is nobody interested in this topic?  Or am I in the wrong list?

```

## Alex Riesen, 2008-10-23 19:05

Subject: Re: How to push to http(s) repository with authentication?
Message-ID: <20081023190544.GA21079@blimp.localdomain>
URL: https://gitlist.dev/e/20081023190544.GA21079%40blimp.localdomain
In-Reply-To: <20081023175336.GA3526@raven.wolf.lan>

```
Josef Wolf, Thu, Oct 23, 2008 19:53:37 +0200:
> On Mon, Oct 20, 2008 at 08:25:02PM +0200, Josef Wolf wrote:
> 
> > I have set up a repository as described in
> > 
> >   http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt
> > 
> > over SSL with basic authentication.  DAV access works fine with konqueror,
> > cadaver and and curl, using this .curlrc:
> > [ ... ]
> 
> Is nobody interested in this topic?  Or am I in the wrong list?

       --cacert <CA certificate>
              (SSL) Tells curl to use the specified certificate file to verify
              the peer. The file may contain  multiple  CA  certificates.  The
              certificate(s) must be in PEM format.

              curl  recognizes the environment variable named ’CURL_CA_BUNDLE’
              if that is set, and uses the given path as a path to a  CA  cert
              bundle. This option overrides that variable.

              The  windows  version  of  curl will automatically look for a CA
              certs file named ´curl-ca-bundle.crt´, either in the same direc‐
              tory as curl.exe, or in the Current Working Directory, or in any
              folder along your PATH.

              If curl is built against the NSS SSL library  then  this  option
              tells  curl the nickname of the CA certificate to use within the
              NSS database defined by the environment variable SSL_DIR (or  by
              default  /etc/pki/nssdb).   If  the NSS PEM PKCS#11 module (lib‐
              nsspem.so) is available then PEM files may be loaded.

              If this option is used several times, the last one will be used.

Does this (setting $CURL_CA_BUNDLE) help?

```

## Josef Wolf, 2008-10-23 22:32

Subject: Re: How to push to http(s) repository with authentication?
Message-ID: <20081023223256.GB3526@raven.wolf.lan>
URL: https://gitlist.dev/e/20081023223256.GB3526%40raven.wolf.lan
In-Reply-To: <20081023190544.GA21079@blimp.localdomain>

```
On Thu, Oct 23, 2008 at 09:05:44PM +0200, Alex Riesen wrote:

Thanks for your response, Alex!

[ ... ]
>        --cacert <CA certificate>
[ ... ]

> Does this (setting $CURL_CA_BUNDLE) help?

Well, as I wrote in my original mail, I already got the certificate
working.  My problem is the usage of the .netrc file.  I don't want
to store passwords in cleartext in files.

So the real question is: how do I make git-http to ask for credentials.

Sorry, I should have made more clearly what's the problem.

```
