• git on Linux

server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

Also seen in: Debian, Ubuntu, Raspberry Pi OS, WSL, CI containers, GitLab, Gitea

In one sentence

GnuTLS, which git uses on Debian and Ubuntu, could not link the server's certificate to any root in the system bundle: usually a missing proxy or private CA root.

Where you see it

git on Debian, Ubuntu and the systems built from them prints this on clone, fetch or push over HTTPS:

$ git clone https://git.example.com/team/app.git
Cloning into 'app'...
fatal: unable to access 'https://git.example.com/team/app.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

The wording depends on the libcurl underneath. From curl 8.10.0 the message names the reason: server verification failed: certificate signer not trusted. (CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none), or certificate has expired, or certificate error, no details available. From curl 8.17.0 the prefix reads SSL certificate verification failed:. Ubuntu 20.04 ships curl 7.68.0, 22.04 ships 7.81.0, 24.04 ships 8.5.0, 26.04 ships 8.18.0 and 26.10 ships 8.20.0, and Debian 12 ships curl 7.88.1 and Debian 13 ships 8.14.1, so as shipped, Ubuntu up to 24.04 and Debian 12 print the bare form, Debian 13 the middle one and Ubuntu 26.04 onwards the newest. All three take the same fixes.

curl on the same machine reports the same fault as unable to get local issuer certificate, because the git package depends on libcurl3-gnutls, the GnuTLS flavour of libcurl (libcurl3t64-gnutls on Debian 13 and Ubuntu 24.04 onwards), while the curl package depends on libcurl4, the OpenSSL flavour (libcurl4t64 on Debian 13 and Ubuntu 24.04 onwards). Git for Windows with Schannel prints a third wording, SEC_E_UNTRUSTED_ROOT.

What it means

git hands HTTPS to libcurl, which hands certificate checking to GnuTLS. GnuTLS builds a path from the server’s leaf certificate through the intermediates it sent, and expects to land on a root certificate in the file named after CAfile:. On Debian-based systems that is /etc/ssl/certs/ca-certificates.crt, the trust store that update-ca-certificates assembles from the system roots. The certificate chain never reached a certificate in that file. Any other path after CAfile: means a config key or environment variable sent git elsewhere. CRLfile: none means no certificate revocation list was configured, which is normal.

A working curl proves nothing here. The curl tool reads CURL_CA_BUNDLE and SSL_CERT_FILE; Python’s requests reads REQUESTS_CA_BUNDLE; Node reads NODE_EXTRA_CA_CERTS. git reads none of them, only its own config keys and the GIT_SSL_* variables, so a root exported for another tool never reaches it.

Likely causes

A TLS-inspecting proxy re-signs your traffic

If github.com fails too, a TLS-inspection proxy or an endpoint agent is re-signing every site with its own certificate authority. Browsers work because IT pushed that CA into their store; git reads the system bundle. Confirm it from the issuer of a public site:

openssl s_client -connect github.com:443 -servername github.com -showcerts </dev/null 2>/dev/null | grep -E '^ [0-9]+ s:|^   i:'

An issuer naming your firewall vendor or your organisation means inspection. Fix: get the proxy’s root as a PEM file from IT and add it to the system bundle:

sudo cp corp-root.pem /usr/local/share/ca-certificates/corp-root.crt
sudo update-ca-certificates
Updating certificates in /etc/ssl/certs...
1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.

The file goes under /usr/local/share/ca-certificates/, must end in .crt and must be PEM, or update-ca-certificates ignores it (convert DER first). 0 added means a rule was broken. Rerun git ls-remote.

A self-hosted GitLab or Gitea behind a private CA

A server with a certificate from a private CA, or a self-signed certificate, fails for the same reason: nothing in CAfile signed it. Confirm with the s_client command above against your git host: the company CA as issuer, or an s: line equal to its i: line, means the server’s own CA.

Fix: install the CA’s root system-wide as above. When you cannot change the system store, scope the root to that host:

git config --global http.https://git.example.com/.sslCAInfo /home/you/certs/corp-root.pem

git matches the key against the remote URL by scheme, host, port, path and user name, longest match winning, so GitHub keeps the system bundle (git-config). Plain http.sslCAInfo replaces the trust store for every remote, so a file holding only your corporate root breaks every public site. For one command, use GIT_SSL_CAINFO=/path/to/root.pem git clone …. See what git already has, stale keys included:

git config --show-origin --get-all http.sslCAInfo
git config --show-origin --get-all http.sslVerify
env | grep -E '^GIT_SSL'

From git 2.46.0 the spelling is git config get --show-origin --all http.sslCAInfo; the older form still works.

An outdated ca-certificates bundle

Let’s Encrypt chained to DST Root CA X3 for old Android until 6 June 2024, and that root had already expired on 30 September 2021. A machine whose ca-certificates package predates ISRG Root X1 has no root for any Let’s Encrypt site. Confirm what git loads:

GIT_CURL_VERBOSE=1 git ls-remote https://git.example.com/team/app.git
ls /etc/ssl/certs/ | grep -i isrg

Older libcurl prints found N certificates in /etc/ssl/certs/ca-certificates.crt; from curl 8.17.0 it prints CAfile: N certificates in …. If N is 0, or you see error reading ca cert file, the bundle is missing or unreadable. Fix:

sudo apt-get update && sudo apt-get install --only-upgrade ca-certificates

If ISRG_Root_X1.pem is still missing, the release no longer gets bundle updates. Install that root by the method above, using the PEM from letsencrypt.org/certificates, and plan the OS upgrade.

The clock is wrong

Validity dates are checked against the local clock. A Raspberry Pi without a real-time clock, a VM restored from a snapshot, or a container started before time sync fails a perfectly good certificate. A clock ahead of the end date prints certificate has expired. curl has no wording for a certificate that is not yet valid, so a clock behind the start date most likely prints certificate error, no details available; we have not reproduced that case. Confirm with date -u and timedatectl. Fix:

sudo timedatectl set-ntp true

In a container, fix the host’s clock; on a Pi that pulls at boot, order the job after time sync.

Check yours

Try it: Chain checkerOpen the full tool

Runs in your browser. Nothing you paste is sent anywhere.

Every certificate the server sends, leaf first. The output of openssl s_client -showcerts -connect example.com:443 works as it is: we ignore the text around the certificates.

Paste the certificates from openssl s_client -showcerts. The checker shows which root the chain needs, and flags root names of known HTTPS-inspection products.

Learn why

Guided mission · free · no account · progress saves hereRepair the missing chain link — 7 minutesFind the intermediate a client is missing and build a path to a root it already trusts.

Does your team keep hitting this?

Everyone can use the lessons. Team seats add earned credentials, invitations and a completion report, so you see who has finished.

See team training

Early edition. Written with AI assistance and checked against primary sources; an independent expert review is planned. Found a mistake? Tell us.

Last reviewed Edition 0.9