Reputation: 141
My PHP Mailgun interface had been working for 2 years until yesterday 1/23/2018 at about 12 noon central time.
Now all calls to the Mailgun API are returning the SSL certificate problem
Exception 0 [curl] 60: SSL certificate problem: unable to get local issuer certificate [url] https://api.mailgun.net/v2/
Curl also returns the same problem at the command line when attempting to access the mailgun API.
We have downloaded and installed the latest cacert.pem file from https://curl.haxx.se/docs/caextract.html and includeded the path to this file in the php.ini file parameter curl.cainfo = /path/to/cacert.pem and the openssl.cafile = /path/to/cacert.pem
We have restarted our application and rebooted our server but the problem is not fixed.
Is anyone else having the same problem with the PHP Mailgun API ? Is there a way to disable the SSL certificate check through the Mailgun API ?
Upvotes: 5
Views: 3141
Reputation: 361
Actually, it's not a bug; it's for security reasons. To make it work, change
$sslEnabled = true
to
$sslEnabled = false
You can read extra details at this github issue.
Upvotes: -3
Reputation: 1
I fixed this problem... you just need to change de "pem" file inside: guzzle/guzzle/src/Guzzle/Http/Resources/
You need to get de cacert.pem here... the last version: https://curl.haxx.se/docs/caextract.html
And after, just change in your folder.
Upvotes: 0
Reputation: 404
I can confirm updating php / curl on my dead ass old production server resolved this problem.
Actually, this should be sufficent:
sudo apt-get update && sudo apt-get upgrade
Upvotes: 0
Reputation: 179
I just came to SO myself to post a resolution my team and I found on this issue as well. As we have a Laravel 4.2 website running Guzzle 4.x for Mailgun mail delivery, all emails ceased functioning as Steve said on 1/23 around Noon.
For us, we simply had to update the cacert.pem found in the /vendor/guzzlehttp directory that the package uses and it came back online.
Upvotes: 0
Reputation: 3
Do we really need to install guzzle to fix this issue? I encounter same issue.
Upvotes: 0
Reputation: 141
The SSL Certificate problem with the PHP Mailgun API was resolved by copying the latest cacert.pem file to the following directory : ..PHP\v5.6\vendor\guzzle\guzzle\src\Guzzle\Http\Resources\
Apparently the PHP MailGun API uses this directory for the certificates when calling the guzzle and curl interfaces. Changing the PHP.ini file parameter curl.cainfo = "/path/to/cacert.pem" is not sufficient to resolve this problem.
Upvotes: 9