git clone: "SSL certificate problem: self-signed certificate in certificate chain" with GitLab
Git connected to the GitLab address, received a certificate chain, and could not end it at a certificate it trusts. This is almost always a Self-Managed GitLab with a company or self-made certificate authority. The fix is on your computer: give Git the CA certificate for that host with http.sslCAInfo. The exact words of the error tell which of three things is wrong, and the certificate list inside your JetBrains IDE is not used by the git command at all.
The messages
GitLab's Troubleshooting SSL page shows two forms for a Git operation:
fatal: unable to access 'https://gitlab.domain.tld/group/project.git/': SSL certificate problem: self signed certificate
fatal: unable to access 'https://gitlab.domain.tld/group/project.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
and lists these under common SSL errors: SSL certificate problem: unable to get local issuer certificate, SSL certificate problem: self signed certificate in certificate chain, unable to verify the first certificate and certificate signed by unknown authority. GitLab's page writes "self signed" without the hyphen; OpenSSL 3.5 writes it with one, as in the title above.
To replace an expired token in one place: Merge Request (MR) Review Inbox for GitLab, a plugin for JetBrains IDEs, says on a 401 that the token expired, was revoked or is from another GitLab instance, and keeps the token in the IDE's password safe, so replacing it there is the only change.
What each wording means
These are OpenSSL's verification errors (OpenSSL 3.5, X509_STORE_CTX_get_error), which Git passes on when it uses OpenSSL:
- self-signed certificate: the certificate the server sent is self-signed and the same certificate is not in the list of trusted certificates. The server presented its own certificate with no authority above it.
- self-signed certificate in certificate chain: the chain could be built from the certificates the server sent, but no suitable trust anchor (typically a self-signed root certificate) is in the trust store. The server certificate is signed by an authority, and your computer does not know that authority.
- unable to get local issuer certificate: the issuer certificate could not be found. On the server this often means the chain it sends is incomplete; GitLab's docs say to send the full chain, with the server certificate first, then all intermediate certificates, and the root last.
So "in certificate chain" points at a missing root or intermediate authority on your side, and the plain "self-signed certificate" points at a server that has no authority at all.
On Windows the words differ
The wording follows the TLS library Git uses. Git for Windows 2.53.0 on November 22, 2026, against a public test server with a self-signed certificate:
fatal: unable to access 'https://HOST/x.git/': schannel: SEC_E_UNTRUSTED_ROOT (0x80090325)
The same command with git -c http.sslbackend=openssl printed:
fatal: unable to access 'https://HOST/x.git/': SSL certificate OpenSSL verify result: self-signed certificate (18)
GitLab's docs give schannel: SEC_E_UNTRUSTED_ROOT (0x80090325) its own entry, with this fix, which makes Git use OpenSSL:
git config --system http.sslbackend openssl
(Git's setting: http.sslBackend, the name of the SSL backend to use, for example "openssl" or "schannel".) With the OpenSSL backend, the CA file of the next section is what Git checks the server against.
See what the server sends
To look at the chain the server presents, GitLab's docs use openssl s_client (on a GitLab server, GitLab's own copy at /opt/gitlab/embedded/bin/openssl; on your computer, openssl):
echo | openssl s_client -connect HOSTNAME:443 echo | openssl s_client -connect HOSTNAME:443 | openssl x509 -text -noout
The first prints the certificates and any validation error; the second prints the details of the first certificate, including who issued it. If the issuer is your company's authority, you have the case below.
Trust the certificate for this host only
GitLab's docs: copy the self-signed certificate or the root CA certificate to your computer and point Git at it:
git config --global http.sslCAInfo ~/.ssl/gitlab.domain.tld.crt
That setting applies to every HTTPS host Git talks to. Git can limit an http.* setting to one URL (http.<url>.*), so write the host into the key:
git config --global http.https://gitlab.domain.tld/.sslCAInfo ~/.ssl/gitlab.domain.tld.crt
That adds this to the global config:
[http "https://gitlab.domain.tld/"] sslCAInfo = ~/.ssl/gitlab.domain.tld.crt
Git's manual: http.sslCAInfo is the file containing the certificates used to verify the peer when fetching or pushing over HTTPS (the environment variable GIT_SSL_CAINFO overrides it). GitLab's docs also show git config --global http.sslVerify false, only as a temporary step for troubleshooting, and recommend SSH remotes as more secure.
The IDE's certificate list does not fix git
JetBrains' help for Server Certificates says the IDE trusts certificates from the JDK's default trust store, and that you can add one to the IDE's own list (stored in ssl/cacerts in the IDE configuration directory) or to the JDK's. It also says that the Git command-line tool does not use these certificates and relies on its own configuration; on Windows you can have Git use the Windows certificate store through Settings | Advanced Settings, "Use Windows certificate store". So accepting a certificate in the IDE helps the IDE's own HTTPS connections, such as calls to the GitLab API, but a git clone or fetch still fails until the git config above is set.
GitLab merge requests and pipelines in IntelliJ IDEA
Lesstep makes two plugins for JetBrains IDEs 2024.1 or later that read GitLab with read_api and change things with api: Merge Request (MR) Review Inbox for GitLab and Pipelines and Jobs Inbox for GitLab CI. When GitLab refuses the token with 401 while they read, they say that the token expired, was revoked or is from another GitLab instance, show GitLab's own description, and offer to open their settings, which have a link to GitLab's form with the name and scope filled in (GitLab 16.7 or later). The token is kept in the IDE's password safe, so replacing it there is the only change. Reading is free; approving, commenting and merging, or retrying, cancelling and running pipelines, are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GITLAB is a trademark of GitLab Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitLab Inc. or JetBrains.
More: GitLab "HTTP Basic: Access denied" · GitLab SSH "Permission denied (publickey)" · GitLab 401 "invalid_token" · GitLab 404 "Project Not Found" · GitLab "insufficient_scope" · GitLab 429 "Retry later" (rate limits) · GitLab merge request plugins for IntelliJ IDEA, compared · 日本語