others-how to solve SSL certificate problem: self signed certificate problem ?

Problem

When we do git pull command like this:

[[email protected] ~]# git clone https://1.2.3.184/bswen/argocd-example-apps

we get this :

Cloning into 'argocd-example-apps'...
fatal: unable to access 'https://1.2.3.184/bswen/argocd-example-apps/': SSL certificate problem: self signed certificate

The core error is : SSL certificate problem: self signed certificate

Why do this error happen? The git repository does exist ,and the url is correct, I promise!!!

Environment

  • git version 2.21.1 (Apple Git-122.3)

Reason

You can connecting to a private gitlab repository or github enterprise repository, the certificate is self-signed, git can not verify the self-signed certifiate if you have not properly load the certificate in the local system.

Solution

You can disable the certificate verification with git configurations.

git config --global http.sslVerify false

Now retry:

➜  git clone https://1.2.3.184/bswen/argocd-example-apps
Cloning into 'argocd-example-apps'...
remote: Enumerating objects: 109, done.
remote: Counting objects: 100% (109/109), done.
remote: Compressing objects: 100% (75/75), done.
remote: Total 109 (delta 25), reused 109 (delta 25), pack-reused 0
Receiving objects: 100% (109/109), 19.25 KiB | 6.42 MiB/s, done.
Resolving deltas: 100% (25/25), done.
➜  

It works!

-->