What means "SSL certificate problem: unable to get local issuer certificate"

In fact, the issue was not with the library, but rather a setting of PHP/cURL/Windows environment.
cURL by default is configured to “not trust any root certificate” . Therefore “the local issuer certificate” could not be found.

To solve this, one needs to tell cURL to trust certain root certificates:

  1. get the root certificate file from the CURL website:
    The Mozilla CA certificate store in PEM format (around 250KB uncompressed) is available from https://curl.haxx.se/docs/caextract.html . This PEM file contains the datestamp of the conversion and they only make a new
    conversion if there’s a change in either the script or the source file.

  2. store this pem file somewhere on your server

  3. tell cURL where to look for this file, by changing the PHP.INI file
    Change:
    ; curl.cainfo =

Change To:
curl.cainfo = “C:\PHP\Extras\SSL\cacert.pem” (or wherever you saved your cacert.pem file)

after these changes, the named error is not showing anymore (at least in my environment).

1 Like