升级到 macOS 10.12 Sierra 后,我无法与加密的 SSL git 服务器同步。通过 Safari 访问服务器时,证书仍然可以正常工作。
我在尝试推送到服务器时收到此消息:
fatal: unable to access 'https://....': SSL: Can't find the certificate "...." and its private key in the Keychain.
证书在钥匙串(keychain)中,名称正确(更新前有效),但不知何故我无法访问它。
我的 ~/.gitconfig 文件仍然包含以下内容:
[http "https://...."]
sslCert = ....
[credential]
helper = osxkeychain
到目前为止还有其他人遇到过这个问题吗?
最佳答案
看起来 git-credential-osxkeychain helper 应用程序在 macOS sierra 上损坏了,将不再检索通过 security find-identities 返回的用户证书
我找到的唯一解决方法是
- 将钥匙串(keychain)中的证书和 key 导出到 my_certificate.p12
为受影响的帐户编辑 .git/config 以供使用
[http] sslCert = /Users/foo/certificates/my_certificate.p12 sslcertpasswordprotected = true
注意:您需要在 P12 上输入密码,并且每次执行 git 命令时都必须输入 p12 的密码。
附:雷达://28461462
关于更新到 macOS Sierra 后,git 无法在钥匙串(keychain)中找到证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39632448/