@braicauc Already been said and you shouldn't use an old version of Guzzle.
If you use guzzle 3.x. You can set ssl verification using setSslVerification method:
$guzzle->setSslVerification(false)
What saved me was disabling the AV, thought should share and hope this helps someone getting error with cert. I tried saving a copy of .pem file and changed my php.ini but that didn't work. I disabled my firewall, alas no effect, and finally I stopped my Anti Virus service and that was it. It worked.
Thanks for all replies around downloading cacert.pem from gitub. It worked for me in Windows 7, wamp64 and Laravel 5.1 with Mailgun. Just wanted to share that I had to add the line - as follow - to C:\wamp64\bin\php\php7.0.0\phpForApache.ini file instead of php.ini file. It should looks like this:
curl.cainfo="C:<full path to your preferred folder>\cacert.pem"
You can still use "guzzlehttp/guzzle": "~5.3|~6.0", in your composer.json but you need to edit the following file in vendor/guzzlehttp/guzzle/src/Client.php
$defaults = [
'allow_redirects' => RedirectMiddleware::$defaultSettings,
'http_errors' => true,
'decode_content' => true,
'verify' => true, // TO BE REPLACED by false
'cookies' => false
];
It can be a security issue, but it worked for me.
@bobinwood Gracias!!
@bobinwood thank you, this worked for me but i still l don't know the downside of it.
@bobinwood Thanks buddy this also worked for me !
@bobinwood after 4 hours looking for a solution , i found your answer ..... thank you
@bobinwood its working thanks
"Keep seeing this error: cURL error 77: error setting certificate verify locations: CAfile: "C:\xampp\sendmail\cacert.pem CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
I use xampp as well as had this same problem...solution was to enter the CORRECT path...
In my case, I had originally entered "C:\xampp\php\cacert.pem" when it should be "\xampp\php\cacert.pem"
Hope this helps someone!
The solutions about are great when you have access to php.ini. I did this more programmatically:
use GuzzleHttp\Client;
// ....
// Workaround
// https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate?page=3#reply-166681
$providerInstance = $socialite->driver($provider);
$providerInstance->setHttpClient(
new Client([
'curl' => [
CURLOPT_CAINFO => base_path('resources/assets/cacert.pem')
]
])
);
$user = $service->createOrGetUser(
$providerInstance->user()
);
thx soo much @moez you are solved my problem. now i can send email form wampserver on laravel with mailgun ^^ i link the "cacert.pem" in my "php.ini" and now all done !!
@Desu, I liked your idea, but in my case, I don't know where I should put this codes. Error 60 is happening to me while using Mail Laravel's class. If you know how to adapt that to it, let me know. Regards!
Following what @layeyr7 suggested, the link updated to https://curl.haxx.se/docs/caextract.html, which will later be resolved to https://curl.haxx.se/ca/cacert.pem.
I've solved using guzzlehttp/guzzle version 6.0, but I believe I could have used the latest version (6.2) as well.
Later on, I've followed what @allenrose mentioned, and put it on Wamp's/PHP php.ini.
SUMMARIZING: If you're also on Windows (and using Wamp64 or similar), do this:
-
Open https://curl.haxx.se/ca/cacert.pem and save the cacert.pem to a path like "C:\wamp64\extras\cacert.pem" - beware to not allow Windows save it like "cacert.pem.txt";
-
Open your php.ini, and locate the "curl.cainfo" line, which should be more or less the line 1859. Update it to (whitout the ; in the beginning too):
curl.cainfo="C:\wamp64\extras\cacert.pem"
-
Restart the services and voilá.
I would also recommend you to let this kind of instructions on your project if someone gets caught on that, along with letting the cacert.pem in some path like "resources/assets/" as a backup quick shortcut.
Thanks for the post, guys.
Hi Guys,
We can solve this problem by replacing this line in php.in file from curl.cainfo to curl.cainfo ="F:\xampp\php\extras\cacert.pem" and put the pem file in appropriate place.
cheers
@mglrahul thanks. This helped me resolve the issue.
@ricardovigatti @Sven0188 is right, but is very important to store "cacert.pem" with your project as well, if this happen to another developer, you'd saving him some hours.
@giovannipds sorry but this was exactly what he said... https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/37017
Sorry for posting being a little anger, but i can't understand why this post continued along with 2 more pages of people asking and answering different bad solutions even after he made a simple and correct answer, with a lot of positive feedbacks...
The "project solution" you are talking was that provided by @Desu a month ago, right? (https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/166681)
It's a very good one too, i only realize now, after your comment.
Hello @ricardovigatti. Yeah, I saw what he said, and followed it up. He's right. But, I've just commented here because this post seemed confusing at first look. I tried to summarize it above, on my second comment.
@Desu's project solution seems to be good too, but I didn't give it a try. Although, it's not that necessary... What I meant to say about, that "you should store cacert.pem with your project", was not because of @Desu's solution, but because of you would have avoid other developers having the same issue with your project, in the future. It could just be a README.md on your project's root, with @Sven1088 instructions there. Also, with cacert.pem already somewhere (because it's a small file). I've stored mine in the project's path "resources/assets/", just as a backup.
So, are we done with this post? I guess we all have already understand it...
Cheers, Gio.
@bobinwood 's solution worked for me after I edited the php.ini file with @Sven0188 's instruction and @GeoffGordon 's file link. My guzzle's version is 6.2.1 . But by following @bobinwood 's solution will there be any risk to my users when they want to log in by using Facebook ? Thanks in advance.
@Sven0188 : Thanks...it solved it.
This answer on SO should help you: http://stackoverflow.com/a/32095378/178163
Especially if you're using Wamp.
Simply restart your server.
@bobinwood Thanks bobin really work. i love you :D
for wamp server, we need to update this php.ini (not from bin/php/php.ini)
(left click ) wampmanager icon -> PHP -> php.ini
Also
$client = new Client([ 'verify' => false ]);
work on Guzzle 6.0.
Thanks! You saved me a lot of time.
In case if there are some peoples still getting this issue, i have 'funny style' to solve this problem and it is quite simple. After reading laravel Mailer source code, and i found something 'funny' without doing anything with php.ini file.
Try adding 'guzzle' => ['verify' => false] in config/services.php right on your driver, that should overwrite default guzzle config for 'verify' which has default value true.
Of course, you can overwrite guzzle config from here to. Hope this will help
Please bear in mind that if you're using xAMPs that change PHP version (for example AMPPS but WAMP does it as well if I'm not mistaken), there might actually be two files that you've got to edit, depending on the environment you're running from (web calls/cmd calls) - one is within given PHP version directory, the other in the apache folder.
i just use the Following code in my Callback controller $providerUser = \Socialite::driver('facebook') ->setHttpClient(new \GuzzleHttp\Client(['verify' => false])) ->user(); its work like a charm
@GeoffGordon you saved the day.
Same problem here
I solve my problem installing this "guzzlehttp/guzzle": "~6.0" composer require guzzlehttp/guzzle:~6.0
Please or to participate in this conversation.