How to fix the «SSL certificate problem: unable to get local issuer certificate» issue?

Step 1

Download the cacert.pem file and place it into a some persistent folder.
Specify the filesystem location to the cacert.pem file in a PHP *.ini file with the curl.cainfo option:

curl.cainfo = "C:/server/pem/cacert.pem"


Step 2

Generate a self-signed certificate:

openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
rm server.pass.key
openssl req -new -key server.key -out server.csr

Leave the challenge password as empty.

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt


Step 3

Add the contents of the generated server.crt file to the end of the cacert.pem file.

Step 4

Restart PHP.

1 Like

See also: