ilovepdf / ilovepdf-php

iLovePDF Rest Api - PHP Library (https://developer.ilovepdf.com)
147 stars 40 forks source link

Fatal error: Uncaught exception 'Exception' with message 'SSL certificate problem: unable to get local issuer certificate' in C:\ilovepdf-php\src\Request.php on line 396 #3

Closed hnk15 closed 7 years ago

hnk15 commented 7 years ago

Fatal error: Uncaught exception 'Exception' with message 'SSL certificate problem: unable to get local issuer certificate' in C:\ilovepdf-php\src\Request.php on line 396

Exception: SSL certificate problem: unable to get local issuer certificate in C:\ilovepdf-php\src\Request.php on line 396

Why we are getting this error?

marcogrossisas commented 7 years ago

@hnk15 This error message tells that you need to install a local certificate when using curl to call a https url. Take a look on how to install it: https://stackoverflow.com/questions/28858351/php-ssl-certificate-error-unable-to-get-local-issuer-certificate

Anyway, we just added a new function $ilovepdf->verifySsl(true). If you set it to false the curl connection won't verify anymore the remote certificate and you won't get an error. But we strongly recommend always to set it to true always for security reasons. Please update to the 1.1.3 version of the library.

hnk15 commented 7 years ago

Ok I've solved this issue for me. Hopefully others experiencing the same problem might benefit from me sharing this.

It's a php config issue.

It's easy to fix (php 5.3.7 or higher) - Download a list file with an up-to-date certificate authorities, and add this setting to your php.ini curl.cainfo=cacert.pem

Please remember the required to be an absolute path. Restart your web server, and it'll work !

Hope that helps thanks!

hnk15 commented 7 years ago

@marcogrossisas, Thanks for your reply!