Argo CD will not trust the certificate of a self-hosted Git server
Your error
x509: certificate signed by unknown authorityFix it fast
Most common cause, 1 of 3The Git server's private CA was never given to Argo CD
Export the CA certificate (or the server's own certificate if it is self-signed) in PEM form and register it for the hostname.
argocd cert add-tls git.example.com --from ./company-ca.pem
argocd repo add https://git.example.com/team/deploy.gitShort answer
In Argo CD, x509: certificate signed by unknown authority means the repo server or the argocd CLI met a certificate from a self-signed or private CA it does not know. Add the CA in PEM form with argocd cert add-tls or the argocd-tls-certs-cm ConfigMap, keyed by hostname. For the CLI, trust argocd-server's certificate. Applies to Argo CD 3.6.
Which cause do you have?
Note which command shows the error, then list the TLS certificates Argo CD holds for Git servers. An error on argocd login points to cause 3; an error on repo add or in the app's status, with the Git host missing from the list, points to cause 1.
argocd cert list --cert-type httpsThen find the line you see in this list and open its fix:
- 1The Git server's private CA was never given to Argo CD
argocd repo add or the Application's condition shows the x509 error, and the Git hostname is not in argocd cert list - 2argocd-tls-certs-cm exists, but Argo CD ignores the entry
The certificate is in the ConfigMap, yet argocd cert list does not show the host or the error stays - 3The argocd CLI does not trust argocd-server's own certificate
The error appears on argocd login, before any Git repository is involved
What does the error look like?
x509: certificate signed by unknown authority
Cause 1 of 3
The Git server's private CA was never given to Argo CD
You seeargocd repo add or the Application's condition shows the x509 error, and the Git hostname is not in argocd cert list
Check
Argo CD refuses a Git server over HTTPS when its certificate is self-signed or signed by a CA that Argo CD does not know, and reports x509: certificate signed by unknown authority. With no certificate stored for a host, Argo CD falls back to the system trust store, which covers well-known CAs such as Let's Encrypt but not a company's own root.
openssl s_client -connect git.example.com:443 -showcerts </dev/nullFix
Export the CA certificate (or the server's own certificate if it is self-signed) in PEM form and register it for the hostname. Certificates are stored per server, not per repository. The --insecure-skip-server-verification flag on repo add also connects, but skips every check, so keep it to throwaway setups.
argocd cert add-tls git.example.com --from ./company-ca.pem
argocd repo add https://git.example.com/team/deploy.gitVerify
After a minute or two for the change to spread, the repo add call succeeds and the app syncs without the x509 condition.
argocd app get my-app --hard-refreshConfirmed by argo-cd.readthedocs.io
Cause 2 of 3
argocd-tls-certs-cm exists, but Argo CD ignores the entry
You seeThe certificate is in the ConfigMap, yet argocd cert list does not show the host or the error stays
Check
The declarative ConfigMap must be named argocd-tls-certs-cm, carry the label app.kubernetes.io/part-of: argocd, and use the bare hostname as each data key. A key such as https://git.example.com/repos/app does not match the server, and a ConfigMap without the label is not used at all.
kubectl -n argocd get configmap argocd-tls-certs-cm -o yamlFix
Rename the key to the hostname alone and add the label. The value holds one or more PEM certificates, which also lets you add the next CA before a planned roll-over.
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-tls-certs-cm
namespace: argocd
labels:
app.kubernetes.io/name: argocd-cm
app.kubernetes.io/part-of: argocd
data:
git.example.com: |
-----BEGIN CERTIFICATE-----
...your CA in PEM...
-----END CERTIFICATE-----Verify
argocd cert list --cert-type https now shows git.example.com, and a hard refresh of the app clears the error.
argocd cert list --cert-type httpsConfirmed by argo-cd.readthedocs.io
Cause 3 of 3
The argocd CLI does not trust argocd-server's own certificate
You seeThe error appears on argocd login, before any Git repository is involved
Check
Without further setup, argocd-server uses an automatically generated self-signed certificate. The CLI on your machine has no reason to trust it, so login and every later command fail the TLS check.
argocd login argocd.example.comFix
Install a certificate from a CA your machines already trust in the argocd-server-tls secret (tls.crt and tls.key). Until then, point the CLI at the server's certificate file with --server-crt, or use --insecure only on a test cluster, since it skips both the certificate and the domain check.
kubectl -n argocd create secret tls argocd-server-tls \
--cert=./argocd.crt --key=./argocd.key
argocd login argocd.example.com --server-crt ./argocd.crtVerify
argocd login reports a successful login without --insecure, and argocd app list returns your apps.
argocd app listConfirmed by argo-cd.readthedocs.io
How do I stop it coming back?
- Keep the company CA bundle in the same Git repo as the Argo CD install, inside argocd-tls-certs-cm, so a rebuilt cluster trusts the Git server from day one.
- Load both the current and the next CA into the ConfigMap before the Git server's certificate is replaced.
- Give argocd-server a certificate from a trusted CA instead of teaching every laptop and CI runner to use --insecure.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.