Tuesday, November 29, 2016

How to fix " cURL error 60: SSL certificate problem unable to get local issuer certificate"

It's related to cURL not being able to get the above file. Providing it solves it but it's better to fix the main problem.Normally Guzzle used to provide a cacert.pem before, but they are not doing it .Libcurl on Windows  used to drive the curl extension for PHP can't access the Windows's certificate store. It needs this information however to check if the SSL certificates provided on https:// URL's are valid. Cacert.pem  basically contain most well-known certificate authorities, these are the companies giving out commercial SSL certificates. So if curl/libcurl/guzzle/... doesn't have any list of valid certificate issuers that it can trust, it will just tell you everything is untrusted. Right way to fix this issue is to provide the cacert.pem.

1. In general you see this type of error:



2.Click on the Link https://curl.haxx.se/ca/cacert.pem go to the page.Right click on the page and copy this certificate bundle on your disk (to be used in php.ini)
Use this certificate root certificate bundle:




3.Save it as cacert.pem.txt


4.Copy it and go to xamp->php->ext



5.Paste it into "C:\xampp\php\ext"



6.Copy the location cacer.pem from address bar



7.Update the php.ini file (insert or edit the following line: curl.cainfo). Go on Xampp Control Panel.Click on config.



8.Click on php.ini


9.Search cainfo in php.ini



10.Find curl.cainfo


11.Update the line curl.cainfo= Paste the location of cacert.pem there



12.uncomment curl.cainfo with the location of cacert.pem



13.Open XAMPP Control Panel and stop the Apache and MySQL



14.Restart Apache and MySQL from XAMPP Control Panel.


15.Go back in the page that was giving error and refresh it.






16.Error will be gone and you will get the result you were looking for




No comments:

Post a Comment