cURL error 60: SSL certificate problem: unable to get local issuer certificate

Published 3 years ago by slim12kg

I just installed mandrill and tried sending a message using the Maill::Send function but i get the error ": cURL error 60: SSL certificate problem: unable to get local issuer certificate". I actually thought it was a problem with curl not on my windows, so i installed curl and a certificated, yet it persist. Any idea what might be the problem?

3 years ago (83,000 XP)

Assuming there are no issues with your code, it could be your firewall. Try disabling your firewall to test.

3 years ago (1,118,220 XP)

You can ignore that warning and give cURL the -k or --insecure param to omit that message.

It's just because it's trying to connect to HTTPS and doesn't have the cert to verify it.


@bashy Please how do i this.Am using a windows OS

3 years ago (1,118,220 XP)

Could be due to firewall as nolros said, have you tried that?

Guess you can't add those params on Mail class stuff.


I'm getting this using Guzzle POSTing to a HTTPS address from my local Homestead VM.

Am I right in thinking I need to make a certificate type file? I've only looked into this issue in the last hour so very rusty!

3 years ago (1,118,220 XP)

Just had a thought, I add Google for my DNS so it could be the default local blocking you from doing it.

sudo nano /etc/resolvconf/resolv.conf.d/base

Add in this

# Google

Then to update the /etc/resolv.conf file, run this

sudo resolvconf -u


Make sure that you have "guzzlehttp/guzzle": "~4.0". It has to be THIS particular version. Can't be higher.

I installed mine using composer require guzzlehttp/guzzle and it installed version 5.2. Which cause it not to send emails. Correcting composer.json and running "composer update" fixed it straight away.


I had the exact same but on Windows & xampp. My solution was as simple as: Follow this link: Copy the entire page and save it in a: "cacert.pem"

Then in your php.ini file insert or edit the following line: curl.cainfo = "[pathtothisfile]\cacert.pem"

Problem solved

3 years ago (1,118,220 XP)

It's related to cURL not being able to get the above file. Providing it solves it but it's better to fix the main problem.




First thanks, I try to do it with putting the line curl.cainfo = "[pathtothisfile]\cacert.pem" in a helper file and load this helper in a composer, but i want to know what is the pathtothisfile ? and where can i put the "cacert.pem" file exactly



I don't know how you are using Guzzle or how it's called within your program but you could try the options below if you can access the Guzzle instance:

// disable cert verification
$guzzle->setDefaultOption('verify', false);

// use a cert
$guzzle->setDefaultOption('verify', '/path/to/cacert.pem');

Where to store the cert? Well it doesn't really matter - maybe /resources/assets/?



This is where I have put the pem file exactly: D:\xampp\php\extras\ssl

In other words under your PHP\extras\ssl folder. I am using XAMP as PHP stack.

Hope it helps


I just spent a number of hours grappling with this. The correct answer is indeed to put the cacert.pem file and amend the php.ini file to match as suggested by Moez above. ..... but I kept on getting CURL error 60's The trick was getting a clean copy of the PEM file! Any method involving windows notepad or other editors corrupts the file and gives the cURL error 60 etc. Finally I found and downloaded a tar file with a clean copy of the cacert.pem file ...... it then all worked perfectly.

Hope this saves others time.


@GeoffGordon That is just a workaround I say. Because there is no such error with Guzzle 4. When we use Guzzle 4 it do not throw such error but for Guzzle 5 it throws.

2 years ago (1,118,220 XP)

It's probably how Guzzle 4/5 handle the command used with cURL. I haven't looked at the code but maybe it ignores SSL certs...

Please sign in or create an account to participate in this conversation.