Member-only story
How to Solve “SSL Certificate Problem: Self-Signed Certificate in Certificate Chain” in Git
When you encounter an error like this:
fatal: unable to access 'https://gitlab.example.com/repo.git/': SSL certificate problem: self-signed certificate in certificate chain
It generally means that Git is unable to verify the SSL certificate used by the server, likely because the certificate is self-signed or not recognized by your system as a trusted certificate. In this article, we’ll go through various steps to troubleshoot and resolve this issue while maintaining good security practices.
What Causes This Error?
SSL certificates are used to establish a secure connection between your machine and the server. When Git tries to access a repository over HTTPS, it checks the validity of the server’s SSL certificate against trusted Certificate Authorities (CAs). If the server’s SSL certificate is self-signed (not issued by a recognized CA), Git will reject the connection by default.
Common Solutions to Resolve the SSL Certificate Problem
Here are some steps to resolve the issue, depending on the context of your use case: