简体   繁体   中英

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.

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.

This usually happens because your Git repository server is hosted inside a private network and uses a locally generated (self signed) TLS certificate. 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.

  1. Disable SSL verification on Git globally: git config --global http.sslVerify false
  2. Clone your repository: git clone <your repo>
  3. Enable SSL verification on Git globally: git config --global http.sslVerify true
  4. Change directory into your repo: cd <your repo>
  5. Disable SSL verification only on your repository: 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. Locate your Git cert.pem file (for me it is in 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. 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. This should not require elevated privileges to complete.

git config http.sslVerify "false"

This command did not require use of the --global argument.

We can use window certificate storage mechanism. Please try this

git config --global http.sslbackend schannel

For github.com you may change protocol from HTTPS to SSH:

  1. open.git/config

  2. fix url in [remote "origin"] block

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

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

If you are connected to a VPN, please try without the VPN. I go this error because of this issue.

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