How to Fix “SSL Certificate Problem: Unable to get Local Issuer Certificate?”

3 votes, average: 5.00 out of 53 votes, average: 5.00 out of 53 votes, average: 5.00 out of 53 votes, average: 5.00 out of 53 votes, average: 5.00 out of 5 (3 votes, average: 5.00 out of 5, rated)
Loading...
SSL Problem Unable to Get Local Issuer Certificate

While working with or using Git Bash, at some point, you might have encountered an “SSL Certificate Problem: Unable to get Local Issuer Certificate.” Facing an ” Unable to get Local Issuer Certificate” error can be frustrating as it doesn’t go away no matter how many times you verify your URL or modify your cURL request.

So, the question that arises here is – “Are there any ways or methods that we can utilize to resolve or fix this error?

The answer to this query is – “Yes.” There are a few methods that you can attempt to resolve the Unable to get Local Issuer Certificate Issue. But before we discuss those methods, it would be better to understand what precisely the SSL Certificate Problem: Unable to get Local Issuer Certificate error is and what causes it.

What is the SSL Certificate Problem: Unable to get Local Issuer Certificate Error?

The SSL Certificate Problem: Unable to get Local Issuer Certificate error is a common issue that developers often encounter while using Git Bash, a Windows command line tool to push, pull, or clone a Git repository.

What Causes the Unable to Get Local Issuer Certificate Error?

The “Unable to Get Local Issuer Certificate” error stems from a misconfigured SSL certificate on your local machine. This misconfiguration prevents a successful HTTPS handshake from taking place.

The error is often linked to self-signed or corporate certificates, particularly with Git. (Self-signed certificates are mainly used in testing or development environments and are not verified by trusted Certificate Authorities. Git may throw an error when encountering such certificates.

Corporate organizations often have their own Certificate Authorities, but these certificates may not be trusted by external services like Git, leading to the same error.) Visual Studio Code users may encounter it due to a misconfigured certificate path on their machine.

How to Fix SSL/TLS error – “SSL Certificate Problem: Unable to get Local Issuer Certificate?”

To fix the SSL/TLS error – “SSL Certificate Problem: Unable to get Local Issuer Certificate,” you can perform any one of the methods mentioned below.

  • Alter the php.ini File
  • Add SSL Certificate to Trusted Certificate Store
  • Reinstall Git & Select SSL Transport Backend Option
  • Grant Repository Access to SSL Certificates or Reassign Path in VS Code
  • Disable SSL certificate

Method 1: Alter the php.ini File

Despite not using Git Bash, if you are facing the Unable to Get Local Issuer Certificate error, use this method to resolve it.

Follow the steps mentioned below to alter the php.ini file:

  • Enter your login credentials to access your web control panel (cPanel).
  • Navigate to File Manager > PHP Software.
  • Open the php.ini file.
  • Click on http://curl.haxx.se/ca/cacert.pem.
  • Download the cacert.pem file.
  • Copy the cacert.pem file to openssl/zend (like – ‘/usr/local/openssl-0.9.8/certs/cacert.pem’.)
  • Navigate to php.ini.
  • Add “cainfo = ‘/usr/local/openssl-0.9.8/certs/cacert.pem” to CURL.
  • Restart PHP and confirm if CURL can read the HTTPS URL or not.

Note: Enter the code mentioned below to resolve the issue without modifying the php.ini file.

$ch = curl_init();

$certificate_location = ‘/usr/local/openssl-0.9.8/certs/cacert.pem’;

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $certificate_location);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $certificate_location);

Method 2: Add SSL Certificate to Trusted Certificate Store

If you are a Git Bash user facing the Unable to Get Local Issuer Certificate error, use this method to resolve it. Follow the steps mentioned below to add an SSL cert to the Trusted Certificate Store:

  1. Copy the Git SSL certificate.
  2. Locate the trusted certificate store (C:\Program Files\Git\mingw64\ssl\certs)
  3. Open ca-bundle.crt file.
  4. Paste the Git SSL certificate at the end of the .crt file.
  5. Save the file.

Method 3: Reinstall Git & Select SSL Transport Backend Option

If facing trouble in running Git commands like – git pull, push, or clone, reinstall Git and select the SSL Transport Backend option. Follow the steps mentioned below to accomplish the same:

  • Uninstall Git by using the Control Panel.
  • Once the uninstallation process is complete, perform these actions:
    • Open a web browser (Google Chrome).In the URL bar, type https://git-scm.com/download/win and press Enter.
    • Download the appropriate Git version.
  • During the installation process, select the SSL Transport Backend option.

Method 4: Grant Repository Access to SSL Certificates or Reassign Path in VS Code

If the Unable to get Local Issuer Certificate error occurs inside VSC, perform the below-mentioned steps to resolve it:

  • Reconfigure Git with the –global flag on your SSL certificate configuration by running the git config –global http.sslBackend schannel command in the terminal.
  • If the error is due to accessibility, set the accessibility at the system level by opening the terminal with administrative privileges and running the git config –system http.sslBackend schannel command.
  • If the error is due to location misconfiguration, use the git config –global http.sslcainfo “Path” command to reassign the path.

Method 5: Disable SSL Certificate

Disabling SSL verification is not recommended for security. Once the SSL cert is disabled, malicious actors can attack the system and access data, leading to breaches and ransomware attacks.

Follow the steps mentioned below to disable the verification of your SSL certificate:

  • To disable SSL certificate validation locally in Git, use the $ git -c http.sslVerify=false clone [URL] command.
  • To disable verification of your SSL cert at a global level, use the $ git config –global http.sslVerify false command.

Note: To re-enable SSL certificate verification, use the $ git config –global http.sslVerify true command.

Conclusion

If you encounter the “SSL Certificate Problem: Unable to get Local Issuer Certificate” error, you can try the following methods one by one until the issue gets resolved/fixed:

  • Modify the php.ini file and set the SSL certificate path.
  • Add the SSL certificate to Git Bash’s trusted store.
  • Reinstall Git and select the SSL Transport Backend during installation.
  • Adjust Git settings in Visual Studio Code or reconfigure SSL paths.
  • Temporarily disable SSL certificate verification (not recommended) but remember to re-enable it for security.

Buy Trusted SSL Certificates Starts at Just $2.99/Year!

<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 109.7 29.02"><defs><style>.cls-1{fill:#fff;}</style></defs><path class="cls-1" d="m5.38,22.85c-3.1-.26-5.3-1.92-5.38-4.8h3.6c.1,1.1.67,1.85,1.78,2.09v-4.58c-2.47-.62-5.38-1.32-5.38-4.87,0-2.83,2.26-4.68,5.38-4.92v-1.94h1.54v1.94c3,.24,5.02,1.85,5.23,4.7h-3.62c-.1-.94-.67-1.66-1.61-1.94v4.54c2.5.65,5.42,1.3,5.42,4.85,0,2.45-1.92,4.73-5.42,4.97v1.94h-1.54v-1.97Zm0-10.25v-4.15c-1.1.17-1.87.84-1.87,2.06,0,1.13.77,1.7,1.87,2.09Zm1.54,3.38v4.2c1.22-.22,1.94-1.06,1.94-2.14s-.82-1.68-1.94-2.06Z"/><path class="cls-1" d="m17.62,8.33h-2.33v-3.1h5.78v17.5h-3.46v-14.4Z"/><path class="cls-1" d="m28.27,17.81c.26,1.39,1.15,2.18,2.71,2.18,1.97,0,2.83-1.46,2.83-5.4-.74,1.03-2.16,1.63-3.7,1.63-3.02,0-5.45-1.9-5.45-5.59,0-3.5,2.21-5.81,5.91-5.81,4.75,0,6.22,3.22,6.22,8.76,0,5.95-1.32,9.17-5.95,9.17-3.72,0-5.5-2.38-5.69-4.94h3.12Zm5.23-7.15c0-1.92-1.1-2.98-2.81-2.98s-2.81,1.18-2.81,2.93c0,1.58.89,2.88,2.93,2.88,1.68,0,2.69-1.13,2.69-2.83Z"/><path class="cls-1" d="m41.28,22.9c-1.22,0-2.09-.86-2.09-1.97s.86-1.97,2.09-1.97,2.04.86,2.04,1.97-.86,1.97-2.04,1.97Z"/><path class="cls-1" d="m49.54,17.81c.26,1.39,1.15,2.18,2.71,2.18,1.97,0,2.83-1.46,2.83-5.4-.74,1.03-2.16,1.63-3.7,1.63-3.02,0-5.45-1.9-5.45-5.59,0-3.5,2.21-5.81,5.91-5.81,4.75,0,6.22,3.22,6.22,8.76,0,5.95-1.32,9.17-5.95,9.17-3.72,0-5.5-2.38-5.69-4.94h3.12Zm5.23-7.15c0-1.92-1.1-2.98-2.81-2.98s-2.81,1.18-2.81,2.93c0,1.58.89,2.88,2.93,2.88,1.68,0,2.69-1.13,2.69-2.83Z"/><path class="cls-1" d="m64.56,17.81c.26,1.39,1.15,2.18,2.71,2.18,1.97,0,2.83-1.46,2.83-5.4-.74,1.03-2.16,1.63-3.7,1.63-3.02,0-5.45-1.9-5.45-5.59,0-3.5,2.21-5.81,5.9-5.81,4.75,0,6.22,3.22,6.22,8.76,0,5.95-1.32,9.17-5.95,9.17-3.72,0-5.5-2.38-5.69-4.94h3.12Zm5.23-7.15c0-1.92-1.1-2.98-2.81-2.98s-2.81,1.18-2.81,2.93c0,1.58.89,2.88,2.93,2.88,1.68,0,2.69-1.13,2.69-2.83Z"/><path class="cls-1" d="m81.79,0h3.29l-6.48,27.07h-3.29L81.79,0Z"/><path class="cls-1" d="m96.89,9.43h3.58l-8.23,19.59h-3.58l2.88-6.62-5.33-12.96h3.77l3.43,9.29,3.48-9.29Z"/><path class="cls-1" d="m105.62,22.73h-3.36v-13.3h3.36v2.06c.84-1.37,2.23-2.26,4.08-2.26v3.53h-.89c-1.99,0-3.19.77-3.19,3.34v6.62Z"/></svg>