How to Fix: “SSL Certificate Problem Unable to get Local Issuer Certificate” Error
Guide to Solve Unable to get Local Issuer Certificate
First, let’s see what the main cause for this error is to occur, and later on, we will see how to solve it.
The main reason for this error to occur is when you are using client SSL and you try to make a request of secured HTTPS source, for which you have to share an SSL/TLS Certificate for the verification of your identity. During this time, if the root certificate doesn’t work properly, then it may cause this error.
To fix this SSL Certificate Problem: Unable to get Local Issuer Certificate, three different solutions are available, from which one will definitely work with the majority of people.
For .PEM Format:
Editing php.ini (Keep SSL)
- Download cacert.pem from https://curl.haxx.se/ca/cacert.pem
- Now, copy cacert.pem into your version of zend/openssl. For example,
‘/usr/local/openssl0.9.8/certs/cacert.pem’.
- Open php.ini file and make the modification in the CURL configuration by adding
"cainfo = ‘/usr/local/openssl-0.9.8/certs/cacert.pem"
- Restart your PHP and see whether the CURL is able to read HTTPS URL or not.
No need to Edit php.ini:
$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);
Disable SSL (Not Advisable)
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
For .CRT Format:
Get the SSL bundle – ca-bundle.crt
https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt
For Eg.: C:/xampp/htdocs/_certs/ca-bundle.crt
Editing php.ini File
Once you find, add or update with below lines into that file:
[CA Certs]
curl.cainfo="C:/xampp/htdocs/_certs/ca-bundle.crt"
openssl.cafile="C:/xampp/htdocs/_certs/ca-bundle.crt"
Restarting PHP
service php5-fpm restart
AboutSSL’s Best Stuff
Related SSL Error Articles:
- How to Fix ERR_SSL_PROTOCOL_ERROR on Google Chrome?
- How to Fix NET::ERR_CERT_REVOKED Error in Different Web Browsers?
- How to Fix the ERR_SSL_VERSION_OR_CIPHER_MISMATCH Error on Google Chrome?
- How to Fix NET::ERR_CERT_COMMON_NAME_INVALID on Chrome?
- How to Fix NET::ERR_CERT_SYMANTEC_LEGACY Error
- How to Fix NET::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN Error on Google Chrome?