Skip to content
ecdsa.com
git over HTTPS with libcurl + OpenSSL (Git for Windows default, macOS Homebrew, Alpine, RHEL)Git

Error message

fatal: unable to access 'https://git.example.com/team/app.git/': SSL certificate problem: unable to get local issuer certificate

Also printed as

  • fatal: unable to access 'https://git.example.com/team/app.git/': SSL certificate OpenSSL verify result: unable to get local issuer certificate (20)

The URL is your remote. With libcurl 8.22 (and possibly other recent releases) the reason reads "SSL certificate OpenSSL verify result: unable to get local issuer certificate (20)". Debian and Ubuntu builds of git use GnuTLS and print "server verification failed: certificate signer not trusted" instead.

What it means

git's HTTPS transport uses libcurl, and libcurl with OpenSSL could not find the CA that issued the last certificate the Git server sent. Either the server leaves out its intermediate, or the chain ends at a root (company CA, proxy CA) that is not in the bundle git uses. On Windows this is the classic symptom of Git for Windows checking against its own bundled CA file instead of the Windows certificate store.

Why it happens

How to fix it

  1. 1.

    Windows: switch git to the Windows certificate store

    With http.sslBackend schannel, Git for Windows verifies through Windows itself and accepts every root that Windows trusts, including those deployed by group policy. This is the clean fix for corporate networks.

    bash
    # Git for Windows: verify with the Windows certificate store, where IT deploys company roots
    git config --global http.sslBackend schannel
    git config --global --get http.sslBackend
  2. 2.

    Trust the CA for one Git host

    A URL-scoped http.<url>.sslCAInfo adds the private CA for that host only; GIT_SSL_CAINFO applies to one command or job.

    bash
    git config --global http."https://git.example.com/".sslCAInfo /etc/ssl/private-ca/corp-root-ca.pem
    # one command or CI job only
    GIT_SSL_CAINFO=/etc/ssl/private-ca/corp-root-ca.pem git clone https://git.example.com/team/app.git
  3. 3.

    Install the root into the system bundle

    On Linux the system bundle is what libcurl reads by default, so adding the root there fixes git together with curl and package managers.

    bash
    # Alpine / Debian / Ubuntu
    cp corp-root-ca.pem /usr/local/share/ca-certificates/corp-root-ca.crt && update-ca-certificates
    # RHEL / Fedora
    cp corp-root-ca.pem /etc/pki/ca-trust/source/anchors/ && update-ca-trust
  4. 4.

    Look for an override that replaces the bundle

    --show-origin tells you which config file sets a CA path. Remove global overrides that should have been host-scoped.

    bash
    git config --show-origin --get-all http.sslCAInfo
    git config --show-origin --get-regexp 'http\..*\.sslcainfo'
    env | grep -E 'GIT_SSL_CAINFO|CURL_CA_BUNDLE|SSL_CERT_FILE'
  5. 5.

    Temporary diagnostic: skip verification for one command

    Use -c http.sslVerify=false only to confirm the diagnosis, never in global config: it exposes credentials and lets anyone on the path modify the code you fetch.

    bash
    # Diagnostic only, for one command
    git -c http.sslVerify=false ls-remote https://git.example.com/team/app.git

Related errors

Browse the full signature error database