title: How to set git client certificate for client authentication?
body: <p>I have my own git repository running under jetty-9.
  I want to know how can i set the git client certificate so my git server (jetty server) would be able to receive the certificate in servlet request and be able to get the git client certificate ad in order to do client authentication.</p>
  <p>Following command i am trying to run,</p>
  <pre class="lang-sh prettyprint-override"><code>git -c http.sslcainfo=D:\jetty\punws-sohanba.sigmasys.net.crt \
      -c http.sslCert=D:\jetty\curl-ca-bundle.crt \
      clone &quot;https://punws-sohanba.sigmasys.net:8443/git.ctr-0.0.1-SNAPSHOT/dashboard-portal/.git&quot;
  </code></pre>
  <p>Where &quot;punws-sohanba.sigmasys.net.crt&quot; is my server cert in order to git-client should accept the self signed certs.</p>
  <p><strong>curl-ca-bundle.crt</strong> is the git cert set in global config of git and also i am explicitly trying to set it via command line as well. (i am not sure i am doing it this right way). This curl-ca-bundle.crt file is also imported to my server.jks file as truststore.</p>
  <p>On server i am not able to get the certificates when i do:</p>
  <pre><code>X509Certificate[] certs = (X509Certificate[])req.getAttribute(
      &quot;javax.servlet.request.X509Certificate&quot;);
  System.out.println(
      &quot;cert name from git client =========&gt;&gt; &quot; + certs[0].getSubjectDN().getName()
  ); //returns null-pointer here
  </code></pre>
  <p>I gives following error on commandline :</p>
  <pre><code>fatal: unable to access 'https://punws-sohanba.sigmasys.net:8443/git.ctr-0.0.1-SNAPSHOT/dashboard-portal/.git/': unable to set private key file: 'D:\jetty\curl-ca-bundle.crt' type PEM
  </code></pre>
  <p>Please suggest.</p>