简体   繁体   中英

Git https access broken on MacOS Sierra / SSL keychain error

after upgrading to MacOS Sierra my Git stopped working with https Repos like GitHub.

git clone https://github.com/monday-consulting/FSDevTools.git
Cloning into 'FSDevTools'...
fatal: unable to access 'https://github.com/monday-consulting/FSDevTools.git/': SSL: Can't find the certificate "My User" and its private key in the Keychain.

It seems like the access to the Keychain is broken (using [credential] helper = osxkeychain ) as I can see the Certificate with it's private key in the keychain. In addition to that I've added it with ssh-add -K ~/.ssh/id_rsa

I've read about this here: https://github.com/curl/curl/pull/1105 but I'm not sure why there is a keychin access anyways?! My .gitconfig has no [http] section at all (with the sslVerify or sslCert properties) so I'm not using any Certificates at all.

The funny thing is - using SourceTree with the same Git executable and "Allow SourceTree to modify my global Git and Mercurial config files" disabled (so using the same .gitconfig) is working without problems.

I've also tried using curl from Homebrew and compiling Git with --with-brewed-curl - nothing changed.

The solution was the environmental variable GIT_SSL_CERT being set. So Git always tried to use a certificate that was not needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM