Introduction
The “SSL Certificate Problem: Unable to Get Local Issuer Certificate” error is a common issue faced by developers when working with Git, especially in secure corporate networks or when connecting to remote repositories over HTTPS. This error occurs when Git cannot verify the SSL certificate of the remote server, usually due to missing or misconfigured certificate authority (CA) certificates on the client machine.
In this guide, we’ll explore the causes of this SSL error, how to diagnose it, and the steps needed to fix it across different operating systems. By the end of this article, you’ll be able to resolve this issue efficiently and securely.
1. What is the ‘SSL Certificate Problem: Unable to Get Local Issuer Certificate’ Error?
When Git tries to connect to a remote repository over HTTPS, it uses SSL (Secure Socket Layer) to establish a secure connection. This connection requires validating the server’s SSL certificate against a set of trusted Certificate Authorities (CAs). The “SSL Certificate Problem” occurs when Git cannot find or verify the SSL certificate chain of the server, causing the connection to fail.
Common Symptoms of This Error:
- Error message displayed in the terminal:
fatal: unable to access 'https://github.com/user/repo.git/': SSL certificate problem: unable to get local issuer certificate - Inability to clone, pull, push, or perform any Git operation involving remote repositories over HTTPS.
2. Common Causes of the SSL Certificate Problem in Git
Several reasons can trigger the “Unable to Get Local Issuer Certificate” error in Git:
A. Missing or Outdated CA Certificates
If the local CA certificate store is missing or outdated, Git may not trust the SSL certificates of remote servers.
- Solution:
- Update the CA certificates on your system to ensure Git has the latest trusted authorities.
B. Misconfigured Git SSL Settings
Incorrect SSL settings in Git’s configuration files can lead to SSL certificate verification failures.
- Solution:
- Check and correct any misconfigurations in the
.gitconfigfile related to SSL.
- Check and correct any misconfigurations in the
C. Corporate or Custom Certificates
In corporate environments, custom SSL certificates issued by internal Certificate Authorities may not be recognized by default on your local machine.
- Solution:
- Manually install the custom or corporate CA certificates to the system’s trusted store.
D. Proxy or Man-in-the-Middle (MITM) Tools
Some proxy servers or network tools that inspect SSL traffic (e.g., corporate firewalls or security tools) can replace the original SSL certificate with a different one that Git does not recognize.
- Solution:
- Configure Git to recognize the proxy server’s certificate.
3. Diagnosing the ‘SSL Certificate Problem’ in Git: A Step-by-Step Approach
To resolve the error, follow these steps to diagnose and identify the root cause:
A. Check Git Configuration for SSL Settings
Inspect Git’s SSL settings in the global configuration file:
git config --global --list
- What to Look For:
- Check for
http.sslCAinfoorhttp.sslBackendsettings that might be pointing to incorrect paths or values.
- Check for
B. Verify System CA Certificates
Ensure that the system’s CA certificates are up to date. On different operating systems, check the following:
- On Windows:
- Certificates are managed through the Windows Certificate Store. Make sure all necessary root CAs are installed.
- On macOS:
- Certificates are managed by the Keychain. Use Keychain Access to verify and update trusted certificates.
- On Linux:
- Certificates are managed by packages like
ca-certificates. Update them using:sudo apt-get update && sudo apt-get install --reinstall ca-certificates
- Certificates are managed by packages like
C. Test SSL Connections with curl
Use curl to test the SSL connection to the remote server:
curl -v https://github.com/user/repo.git
- What to Look For:
- Look for error messages related to SSL certificates in the output.
- Verify whether the certificate chain is valid or if there is an issue with the CA.
4. Practical Solutions to Fix the ‘SSL Certificate Problem’ in Git
Based on the diagnosis, here are the practical steps to fix the “SSL Certificate Problem” in Git:
A. Update or Install CA Certificates
Ensure your system has the latest CA certificates installed:
- On Windows:
- Download the latest CA certificates bundle (e.g., from curl.haxx.se).
- Configure Git to use the updated CA bundle:
git config --global http.sslCAinfo "C:\path\to\ca-bundle.crt"
- On macOS:
- Use the Keychain Access app to update or add necessary certificates.
- On Linux:
- Update the CA certificates package:
sudo apt-get update && sudo apt-get install --reinstall ca-certificates
- Update the CA certificates package:
B. Configure Git to Recognize Custom or Corporate Certificates
If you are using a custom or corporate certificate, add it to Git’s trusted CA store:
- On Windows:
- Add the certificate to the Windows Certificate Store and configure Git:
git config --global http.sslCAinfo "C:\path\to\corporate-cert.crt"
- Add the certificate to the Windows Certificate Store and configure Git:
- On Linux/macOS:
- Copy the custom certificate to the CA certificates directory and update the store:
sudo cp corporate-cert.crt /usr/local/share/ca-certificates/ sudo update-ca-certificates
- Copy the custom certificate to the CA certificates directory and update the store:
C. Bypass SSL Verification Temporarily (Not Recommended for Production)
You can bypass SSL verification as a temporary measure. Note: This is insecure and should only be used for testing.
git config --global http.sslVerify false
- Warning:
- Disabling SSL verification makes your connection vulnerable to MITM attacks. Re-enable it as soon as possible:
git config --global http.sslVerify true
- Disabling SSL verification makes your connection vulnerable to MITM attacks. Re-enable it as soon as possible:
D. Configure Git to Use an SSL Proxy or MITM Tool Certificate
If you are behind a proxy or using a tool that inspects SSL traffic, you may need to add its certificate to Git’s trusted CA list:
- Download the Proxy’s SSL Certificate:
- Obtain the certificate from your network administrator or export it from the browser.
- Configure Git to Use the Proxy Certificate:
git config --global http.sslCAinfo "/path/to/proxy-certificate.crt"
5. Best Practices to Avoid SSL Certificate Errors in Git
To prevent future SSL certificate errors, follow these best practices:
- A. Regularly Update CA Certificates:
- Keep your system’s CA certificates up to date to ensure compatibility with all servers.
- B. Validate Certificates Before Adding Them:
- Always validate certificates from trusted sources to prevent security breaches.
- C. Use HTTPS Over HTTP:
- Always use HTTPS for secure communication with remote repositories.
- D. Document Network Changes:
- Keep documentation of any network changes, proxy configurations, or custom certificates that might impact SSL connections.
Conclusion
The “SSL Certificate Problem: Unable to Get Local Issuer Certificate” error in Git can be frustrating, but with the right approach, it can be resolved quickly. By understanding the causes and following the steps outlined in this guide, you can securely connect to remote repositories over HTTPS and avoid SSL issues in the future.
Have you faced SSL certificate errors in Git? Share your solutions and tips in the comments below, and subscribe to our newsletter for more troubleshooting guides and developer insights!

Leave a Reply