I can push by clone project using ssh, but it doesn't work when I clone project with https. it shows message error as below.
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Join Stack Overflow to learn, share knowledge, and build your career.
|
I can push by clone project using ssh, but it doesn't work when I clone project with https. it shows message error as below.
|
|||||||||
|
|
TLDR:
Long answer The basic reason is that your computer doesn't trust the certificate authority that signed the certificate used on the Gitlab server. This doesn't mean the certificate is suspicious, but it could be self-signed or signed by an institution/company that isn't in the list of your OS's list of CAs. What you have to do to circumvent the problem on your computer is telling it to trust that certificate - if you don't have any reason to be suspicious about it. You need to check the web certificate used for your gitLab server, and add it to your To check if at least the clone works without checking said certificate, you can set:
But that would be for testing only, as illustrated in "SSL works with browser, wget, and curl, but fails with git", or in this blog post. Check your GitLab settings, a in issue 4272. To get that certificate (that you would need to add to your
(with ' To check the CA (Certificate Authority issuer), type a:
Findekano adds in the comments:
Also, see my more recent answer "github: server certificate verification failed": you might have to renistall those certificates:
|
|||||||||||||||||||||
|
Open your terminal and run following command:
It works for me and I am using Linux system. |
|||||||||||||||||||||
|
|
Another cause of this problem might be that your clock might be off. Certificates are time sensitive. To check the current system time:
You might consider installing NTP to automatically sync the system time with trusted internet timeservers from the global NTP pool. For example, to install on Debian/Ubuntu:
|
|||||||||||||||||||||
|
|
Had same problem. Caused by self issued certificate authority. Solved it by adding .pem file to /usr/local/share/ca-certificates/ and calling
PS: pem file in folder ./share/ca-certificates MUST have extension .crt |
|||||||||||||
|
|
Check your system clock,
If it's not correct the certificate check will fail. To correct the system clock,
The clock should synchronize itself. Finally enter the clone command again. |
|||||||||
|
should tell you where the problem is. In my case it was due to cURL not supporting PEM certificates when built against NSS, due to that support not being mainline in NSS (#726116 #804215 #402712 and more). |
|||||
|
|
Or simply run this comment to add the server Certificate to your database:
Then do git clone again. |
|||||
|
|
I messed up with my CA files while I setup up goagent proxy. Can't pull data from github, and get the same warning:
use Vonc's method, get the certificate from github, and put it into /etc/ssl/certs/ca-certificates.crt, problem solved.
|
|||
|
|
|
there is no need to set git ssl verification to set to false. It is caused when the system does not have the all CA authority certificates. Mostly people who have genuine SSL certificate missing the intermediate certificate. Just adding the complete text of intermediate certificate (whole chain of missing CA and intermediate certificate) to
works without running the Same goes for manually generated certificates, just add the CA certificate text. At the end : Push successful: Everything is up-to-date |
|||||||||
|
|
If you are using a git server inside a private network and are using a self-signed certificate or a certificate over an IP address ; you may also simply use the git global config to disable the ssl checks:
|
|||
|
|
|
I installed Xubuntu on a Raspberry pi 2, found the same issue with time, as NTP and Automatic Server sync was off (or not installed) . Get NTP
and change the "Time and Date" from "Manual" to "Keep synchronized with Internet Servers" |
|||
|
|
|
Eventually, add the http.sslverify to your .git/config.
|
|||
|
|
|
I just encountered the very same problem with a git repository which always works for me. The problem was that I accessed it through public WiFi access, which redirects to a captive portal upon the first connection (for example to show ads and agree with tos). |
|||
|
|