最近,我的工作场所已经更新了互联网使用策略,并设置了一个Sophos安全层来监控流量。
我试图克隆一个git (使用git clone命令),但是得到了以下错误
fatal: unable to access 'https://github.com/openssl/openssl.git/': SSL certificate problem: self signed certificate in certificate chain这是“暗含的”证书问题。我该怎么做呢?
UPDATE1:证书在成功使用浏览器(Firefox)时是正确的,问题是如何使用这些证书来启用git验证。
将从Firefox获取的证书(从火狐>首选项>隐私与安全>证书>视图Certificates__导出)复制到/etc/ssl/certs。
作为根c_rehash /etc/ssl/certs和git config --system http.sslCAPath /etc/ssl/certs执行。
产生以下响应。克隆开始并中途死亡。
Cloning into 'openssl'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (8/8), done.
fatal: The remote end hung up unexpectedly.89 MiB | 16.11 MiB/s
fatal: early EOF
fatal: index-pack failed发布于 2019-01-28 14:34:07
看起来索福斯的安全性就像MITM一样,所以你应该禁用这个回购的SSL/TLS检查。使用堆栈溢出的回答:
若要禁用对单个git命令的TLS/SSL验证,请尝试使用适当的配置变量将
-c传递给git,或使用Flow的答案:
git -c http.sslVerify=false clone https://example.com/path/to/git 若要禁用对特定存储库的SSL验证(如果存储库完全处于您的控制之下),您可以尝试:
git config http.sslVerify false此问题不在证书中,因为此证书(自签名)在您的计算机上(在SO磷安全软件中)。您可以通过停止Sophos软件(如果您有权限)来证明这一点,然后再试一次(浏览器也是如此)。
要安装此证书(如果浏览器接受它),打开浏览器,将其指向SSL/TLS站点,单击左侧站点并下载证书( PEM格式)。然后在/etc/ssl/certs和exec (最终) c_rehash /etc/ssl/certs中复制文件
你也可以试着执行
git config http.sslCAInfo /etc/ssl/certs/<self-signed certificate>.pem或
git config --system http.sslCAPath /etc/ssl/certs使git接受此证书
你也可以用手做一些事情。在config目录中搜索.git文件。并在[http]一节中添加以下几行:
[http]
sslCAInfo = /etc/ssl/certs/<certificate>.pem
sslCAPath = /etc/ssl/certs/<certificate>.pem
sslCert = /etc/ssl/certs/<certificate>.pemhttps://unix.stackexchange.com/questions/497190
复制相似问题