Search code examples
windowsgitsmartcardcac

Windows GIT using HTTPS client auth from smartcard token


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.

Solution

  • 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]"