简体   繁体   English

SSL 证书问题:证书链中的自签名证书

[英]SSL certificate problem: self signed certificate in certificate chain

I have upgraded my Inteliij IDEA 2019.2 recently and I am getting below error, if I try to pull from my IDE Git Pull Failed: unable to access ' https://github.xxx.com/app-Hello-USD/DGS.git/ ': SSL certificate problem: self signed certificate in certificate chain.我最近升级了我的 Inteliij IDEA 2019.2,如果我尝试从我的 IDE 拉取 Git Pull Failed: unable to access ' https://github.xxx.com/app-Hello-USD/DGS.git ,我会遇到以下错误/ ':SSL 证书问题:证书链中的自签名证书。

Could some one help me what option I have to enable.有人可以帮我启用什么选项吗?

Thanks谢谢

git config --global http.sslVerify false

To expand on the answer of @CrazyCoder.扩展@CrazyCoder 的答案。

This usually happens because your Git repository server is hosted inside a private network and uses a locally generated (self signed) TLS certificate.这通常是因为您的 Git 存储库服务器托管在专用网络中并使用本地生成的(自签名)TLS 证书。 Because this certificate is not from a "trusted" source, most software will complain that the connection is not secure.由于此证书并非来自“受信任”来源,因此大多数软件都会抱怨连接不安全。

So you need to disable SSL verification on Git to clone the repository and immediately enable it again, otherwise Git will not verify certificate signatures for any other repository.所以你需要在 Git 上禁用 SSL 验证来克隆存储库并立即再次启用它,否则 Git 将不会验证任何其他存储库的证书签名。

  1. Disable SSL verification on Git globally: git config --global http.sslVerify false全局禁用 Git 上的 SSL 验证: git config --global http.sslVerify false
  2. Clone your repository: git clone <your repo>克隆你的仓库: git clone <your repo>
  3. Enable SSL verification on Git globally: git config --global http.sslVerify true在 Git 上全局启用 SSL 验证: git config --global http.sslVerify true
  4. Change directory into your repo: cd <your repo>将目录更改为您的仓库: cd <your repo>
  5. Disable SSL verification only on your repository: git config --local http.sslVerify false仅在您的存储库上禁用 SSL 验证: git config --local http.sslVerify false

If you want to add the self-signed cert, export the cert you want as a Base-64 encoded .CER file.如果要添加自签名证书,请将所需的证书导出为 Base-64 编码的 .CER 文件。 Locate your Git cert.pem file (for me it is in C:\Program Files\Git\usr\ssl\cert.pem ).找到您的 Git cert.pem 文件(对我来说它位于C:\Program Files\Git\usr\ssl\cert.pem中)。 Open up your .CER file in a text-editor, and copy/paste the contents at the end of your cert.pem file.在文本编辑器中打开 .CER 文件,然后将内容复制/粘贴到 cert.pem 文件的末尾。 Save the file.保存文件。 Then open up your console and type然后打开你的控制台并输入

 git config --global http.sslCAInfo "C:\Program Files\Git\usr\ssl\cert.pem"

From my chief of IT: this can be fixed by disabling SSL checking in the git config for the affected repositories.来自我的 IT 主管:这可以通过在受影响的存储库的 git 配置中禁用 SSL 检查来解决。 This should not require elevated privileges to complete.这不应该需要提升的权限来完成。

git config http.sslVerify "false"

This command did not require use of the --global argument.此命令不需要使用 --global 参数。

We can use window certificate storage mechanism.我们可以使用 window 证书存储机制。 Please try this请试试这个

git config --global http.sslbackend schannel git 配置 --global http.sslbackend schannel

For github.com you may change protocol from HTTPS to SSH:对于 github.com,您可以将协议从 HTTPS 更改为 SSH:

  1. open.git/config打开.git/config

  2. fix url in [remote "origin"] block修复 [remote "origin"] 块中的 url

    old: url = https://github.com/myname/proj1旧:url = https://github.com/myname/proj1

    new: url = git@github.com:myname/proj1.git新:url = git@github.com:myname/proj1.git

If you are connected to a VPN, please try without the VPN.如果您连接到 VPN,请尝试不使用 VPN。 I go this error because of this issue.由于这个问题,我出现了这个错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Git - “SSL证书问题:证书链中的自签名证书” - Git - “SSL certificate issue: self signed certificate in certificate chain” Azure DEVOPS 中的 GIT 错误 - SSL 证书问题:证书链中的自签名证书推送 - GIT error in Azure DEVOPS - SSL certificate problem: self signed certificate in certificate chain Pushing 无法访问“https://github.com/user name/projectName.git/”:SSL 证书问题:证书链中的自签名证书 - unable to access 'https://github.com/user name/projectName.git/': SSL certificate problem: self signed certificate in certificate chain GitHub证书链中的自签名证书 - Self signed certificate in certificate chain with GitHub 与Jenkins的GIT失败,错误为“证书链中的自签名证书” - GIT with Jenkins failed with error “self signed certificate in certificate chain” Android Studio 到 BitBucket 推送错误 - 证书链中的自签名证书 - Android Studio to BitBucket push error - self signed certificate in certificate chain 如何让Git接受我自己签署的SSL证书? - How to get Git accept my self signed SSL certificate? 带有自签名证书,https的egit - egit with self signed certificate, https 如何解决SSL证书:从github克隆repo时自签名证书? - How to solve SSL certificate: self signed certificate when cloning repo from github? git SSL证书-访问时无效的证书链 - git SSL certificate- Invalid certificate chain while accessing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM