<!-- https://pkizerotohero.com/errors/git-server-certificate-verification-failed-cafile/ | Markdown mirror of the HTML page | PKI Zero to Hero, by Duyutech BV -->

> Fix git's server certificate verification failed. CAfile: … on Debian and Ubuntu: find the root GnuTLS is missing and install it without disabling checks.

Source: https://pkizerotohero.com/errors/git-server-certificate-verification-failed-cafile/ · Last reviewed: 2026-10-24

- 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.

[Check yours: Chain checker](https://pkizerotohero.com/tools/chain/)

## Where you see it

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

```text
$ 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](https://pkizerotohero.com/errors/curl-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](https://pkizerotohero.com/errors/git-schannel-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](https://pkizerotohero.com/handbook/glossary/#leaf-certificate) through the [intermediates](https://pkizerotohero.com/handbook/glossary/#intermediate-certificate) it sent, and expects to land on a [root certificate](https://pkizerotohero.com/handbook/glossary/#root-certificate) in the file named after `CAfile:`. On Debian-based systems that is `/etc/ssl/certs/ca-certificates.crt`, the [trust store](https://pkizerotohero.com/handbook/glossary/#trust-store) that `update-ca-certificates` assembles from the system roots. The [certificate chain](https://pkizerotohero.com/handbook/glossary/#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](https://pkizerotohero.com/handbook/glossary/#crl) 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](https://pkizerotohero.com/handbook/glossary/#tls-inspection) proxy or an endpoint agent is re-signing every site with its own [certificate authority](https://pkizerotohero.com/handbook/glossary/#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:

```bash
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:

```bash
sudo cp corp-root.pem /usr/local/share/ca-certificates/corp-root.crt
sudo update-ca-certificates
```

```text
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](https://pkizerotohero.com/guides/convert-der-pem/)). `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](https://pkizerotohero.com/handbook/glossary/#private-ca), or a [self-signed certificate](https://pkizerotohero.com/handbook/glossary/#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](https://pkizerotohero.com/handbook/glossary/#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:

```bash
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](https://git-scm.com/docs/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:

```bash
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:

```bash
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:**

```bash
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](https://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:**

```bash
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.

Warning

Why http.sslVerify=false is a trap

`git config --global http.sslVerify false` and `export GIT_SSL_NO_VERIFY=true` switch the check off for every remote, and stay off after you have forgotten them. Verification is the only thing stopping anyone on the network path from reading your token and pushing code as you. `http.sslVerify` defaults to true for a reason: trust the right root instead.

## Check yours

*Interactive tool: Chain checker (runs in the browser at [/tools/chain/](https://pkizerotohero.com/tools/chain/))*

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

- [Who do we trust? CAs, trust stores and self-signed certificates](https://pkizerotohero.com/handbook/trust-stores/): which store each tool reads.
- [Certificate chains and path validation](https://pkizerotohero.com/handbook/certificate-chains/): what GnuTLS checks.
- Related: [unable to get local issuer certificate](https://pkizerotohero.com/errors/curl-unable-to-get-local-issuer-certificate/) (curl), [schannel: SEC\_E\_UNTRUSTED\_ROOT](https://pkizerotohero.com/errors/git-schannel-sec-e-untrusted-root/) (Windows), [How to trust a private root CA on Linux](https://pkizerotohero.com/guides/add-root-ca-linux/) and [How to work behind a TLS-inspecting corporate proxy, safely](https://pkizerotohero.com/guides/corporate-proxy-certificates/).
- Sources: [git-config](https://git-scm.com/docs/git-config), [curl: SSL certificate verification](https://curl.se/docs/sslcerts.html), the curl [8.10.0](https://curl.se/ch/8.10.0.html) and [8.17.0](https://curl.se/ch/8.17.0.html) changelogs, [update-ca-certificates(8)](https://manpages.debian.org/bookworm/ca-certificates/update-ca-certificates.8.en.html) and [Let’s Encrypt on DST Root CA X3](https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/).

**Early edition.** Written with AI assistance and checked against primary sources; an independent expert review is planned. Found a mistake? [Tell us](https://pkizerotohero.com/contact/?topic=content-error&page=/errors/git-server-certificate-verification-failed-cafile/).

Last reviewed 24 October 2026Edition 0.9

## Learn why it happens

- [Chapter 12: Who do we trust? CAs, trust stores and self-signed certificates](https://pkizerotohero.com/handbook/trust-stores/)
- [Chapter 13: Certificate chains and path validation](https://pkizerotohero.com/handbook/certificate-chains/)

## Everything on this topic

- [Chains and trust stores](https://pkizerotohero.com/topics/chains-and-trust/)
