Skip to content
LatchkeyLatchkey home

Git "SSL certificate problem: self-signed certificate" in CI

Git could not verify the TLS certificate of the Git host over HTTPS. Either the runner is missing CA certificates, or a corporate proxy is presenting its own self-signed certificate the runner does not trust.

What this error means

An HTTPS clone/fetch fails during the TLS handshake with SSL certificate problem: self signed certificate in certificate chain (or unable to get local issuer certificate). It is environment-specific - fine on a dev machine, failing on a bare CI image or behind a proxy.

git clone output
fatal: unable to access 'https://git.example.com/org/repo.git/':
SSL certificate problem: self signed certificate in certificate chain

Diagnose it: depth, refs, or credentials?

Terminal
git rev-parse --is-shallow-repository
git rev-parse --abbrev-ref HEAD    # prints HEAD when detached
git log --oneline -3
git remote -v

Common causes

Missing or stale CA certificates

A minimal runner image without ca-certificates has no trust store, so Git cannot validate the host’s certificate chain.

A proxy intercepting TLS

Corporate proxies re-sign HTTPS with their own root CA. Unless that root is trusted by the runner, Git treats the certificate as self-signed and aborts.

How to fix it

Install CA certificates

Add the trust store so Git can validate standard certificates.

Terminal
# Debian/Ubuntu
apt-get update && apt-get install -y ca-certificates
update-ca-certificates

Trust the proxy/internal root CA

Point Git at the proxy or internal CA bundle rather than disabling verification.

Terminal
git config --global http.sslCAInfo /etc/ssl/certs/corporate-root.pem
# scoped to one host:
git config --global http."https://git.example.com/".sslCAInfo /etc/ssl/certs/corporate-root.pem

How to prevent it

  • Use a runner image with ca-certificates preinstalled.
  • Provide the internal/proxy root CA to Git’s trust store, not per-command flags.
  • Never disable http.sslVerify as a standing configuration.

Frequently asked questions

What causes Git "SSL certificate problem: self-signed certificate" in CI?
There are 2 common causes: missing or stale ca certificates and a proxy intercepting tls. A minimal runner image without ca-certificates has no trust store, so Git cannot validate the host’s certificate chain.
How do I fix Git "SSL certificate problem: self-signed certificate" in CI?
There are 2 fixes depending on which cause you have: install ca certificates and trust the proxy/internal root ca. Work through them in order, since the first is the most common.
What does Git "SSL certificate problem: self-signed certificate" in CI actually mean?
An HTTPS clone/fetch fails during the TLS handshake with SSL certificate problem: self signed certificate in certificate chain (or unable to get local issuer certificate).
How do I stop Git "SSL certificate problem: self-signed certificate" in CI happening again?
Use a runner image with ca-certificates preinstalled. The prevention section lists 3 changes that keep it from recurring.

Related guides

References

This is a transient network failure, not a bug in your code. Latchkey detects, repairs, and retries it for you. Start free → 30-day trial · No credit card