Windows GIT using HTTPS client auth from smartcard token

1.1k views Asked by At

On Windows, how does one configure GIT to prompt or otherwise use a client HTTPS certificate when connecting to an HTTPS repository that requires HTTPS Client authentication?

Complications:

  1. SSL is blocked by firewalls, can't sidestep the problem.
  2. Private Key is locked onto smart card, cannot extract or replace.
2

There are 2 answers

1
IMarvinTPA On BEST ANSWER

Solution:

    git clone -c http.sslCert="CurentUser\MY\[thumbprint of cert]" [URL]

Or .gitconfig:

    [http]
        sslCert=CurrentUser\\MY\\[thumbprint of cert]

PS, for CURL, it is --cert or -K "CurrentUser\MY[thumbprint]"

1
Brandon M. On

I just want to say that IMarvinTPA's answer worked great for me, I did have to do one other thing however:

.gitconfig

[http]
sslbackend = schannel
sslCert=CurrentUser\\MY\\[thumbprint of cert]

EDIT: Sorry I did not have the reputation to just comment on the answer