Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 774
user3123934 Avatar asked Aug 02 '19 13:08

user3123934


People also ask

How do I bypass SSL certificate in Git clone?

Prepend GIT_SSL_NO_VERIFY=true before every git command run to skip SSL verification. This is particularly useful if you haven't checked out the repository yet. Run git config http. sslVerify false to disable SSL verification if you're working with a checked out repository already.

How do you resolve error self-signed certificate in certificate chain in Postman?

If you are using a self-signed certificate, make sure to add correct client certificate files (CRT, KEY, or PFX) from Settings > Certificates > Client Certificates > Add Certificate. Note: You can check for certificate data being used from the Network response pop-up or the console as explained here.

What is SSL certificate in Git?

When pushing, pulling, or cloning, Git cannot verify your SSL certification, which leads to the error. A valid HTTPS handshake requires both the client and the server to create a secure connection, allowing for safe communication between your local machine and where the source code is hosted.


3 Answers

git config --global http.sslVerify false

like image 53
CrazyCoder Avatar answered Oct 11 '22 04:10

CrazyCoder


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
like image 14
Boško Bezik Avatar answered Oct 11 '22 04:10

Boško Bezik


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"
like image 4
codeMonkey Avatar answered Oct 11 '22 05:10

codeMonkey