Eliya Cohen
Eliya Cohen

Reputation: 11498

cacert.pem - certificate has expired

When I try to execute a cURL via php on my Linux machine, I get the following error:

SSL certificate problem: certificate has expired

my cacert.pem is the latest version according to https://curl.haxx.se/ca/cacert.pem

I have the following lines in the php.ini file (edited):

[openssl]
;...
openssl.cainfo = /etc/ssl/certs/cacert.pem

;...
openssl.cafile = /etc/ssl/certs/cacert.pem

Details:


Btw, I'm pretty much a newbie when it comes to this issues. I'm sure I missed something. I was looking on previous answers in here, and I still couldn't figure it out.

Update 1 - When I use the Postman chrome application, everything is working properly.

Upvotes: 0

Views: 7960

Answers (1)

Tony DiFranco
Tony DiFranco

Reputation: 843

curl uses a different certificates path... try adding this to your php.ini file:

curl.cainfo = "/etc/ssl/certs/cacert.pem"

if you are still having issues, you can try to run curl in "insecure" mode by disabling ssl verification via the CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST settings

Upvotes: 2

Related Questions