Our Git server is being changed to require a certificate/private key when accessed by Git clients.
Our Windows users are instructed to import the certificate locally and then configure Git to use the schannel
backed for SSL as in
git config --global http.sslBackend schannel
This will obviously not work for macOS users. Is there a way to do something similar with the Git client on macOS?
I found that I can point to the certificate and private key in my Git config, if a) they are in separate files, and b) are in .pem
format, like this:
git config --global http.sslCert /Users/.../cert.pem
git config --global http.sslKey /Users/.../key.pem
git config --global http.sslCertPasswordProtected true
After doing this, whenever I try to push/pull, the Git client asks about the password for the private key, like this:
$ git pull
Password for 'cert:////Users/.../cert.pem': *********
Already up to date.
Is there a way to tell the Git client (or the underlying curl
client) to use the macOS Keychain for retrieving the certificate, the key and the also the key's passphrase?
I know that newer versions of curl
support the -E/--cert
parameter to use the keychain, but I'm not sure whether that is available via the Git client.