cURL error 60: SSL certificate in Laravel 5.4
Do not ever modify files in the vendor/
folder. Ever. They can and will be overwritten on the next composer update you run.
Here is my Solution for WampServer
I am using PHP 7.1.9 for my WampServer, so change 7.1.9
in the example below to the version number you are currently using.
- Download this file: http://curl.haxx.se/ca/cacert.pem
- Place this file in the
C:\wamp64\bin\php\php7.1.9
folder - Open
php.ini
and find this line:
;curl.cainfo
Change it to:
curl.cainfo = "C:\wamp64\bin\php\php7.1.9\cacert.pem"
Make sure you remove the semicolon at the beginning of the line.
Save changes to php.ini
, restart WampServer, and you're good to go!
How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication
https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate
https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/52954
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 https://gist.github.com/VersatilityWerks/5719158/download and downloaded a tar file with a clean copy of the cacert.pem file ...... it then all worked perfectly."
And since you are working on Windows, this could be the problem.
cURL error 60: SSL certificate in Laravel 5.3
I'll be fully honest, I don't know anything about Laravel. But I had the same problem, so as many other, on Symfony. And so as you I tried many things without success.
Finally, this solution worked for me :
URL solution
It indicates that instead of a certificate problem, it could came from a environnement non-compatibility. I used XAMPP instead of WAMP and it worked.
cURL error 60: SSL certificate: unable to get local issuer certificate
How to solve this problem:
download and extract cacert.pem following the instructions at https://curl.se/docs/caextract.html
save it on your filesystem somewhere (for example, XAMPP users might use
C:\xampp\php\extras\ssl\cacert.pem
)in your php.ini, put this file location in the
[curl]
section (putting it in the[openssl]
section is also a good idea):
[curl]
curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"
[openssl]
openssl.cafile = "C:\xampp\php\extras\ssl\cacert.pem"
- restart your webserver (e.g. Apache) and PHP FPM server if applicable
(Reference: https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate)
How solve cURL error 60: SSL certificate in Laravel 5?
Try disabling CURLOPT_SSL_VERIFYPEER
to stop cURL from verifying the peer's certificate:
$client->getClient()
->setDefaultOption('config/curl/' . CURLOPT_SSL_VERIFYPEER, false);
cURL error 60: SSL cert issue when sending email with artisan command
You can either modify the vendor folder GuzzleHttp\Client
change verify
key to false
from configureDefaults
method as I did in my local machine
or
You can read this conversation in Laracasts and try downloading the .pem
files in some of the comments.
Here are some links:
- .pem File Download
After that you should edit your php.ini file accordingly:
curl.cainfo = "[pathtothisfile]\cacert.pem"
PS: I would just edit the vendor file, because it's much faster and not hard to realize.
cURL error during making API call. cURL Error Number:[60] SSL certificate prob: self signed certificate in certificate chain
you go to /vendor/quickbooks/v3-php-sdk/src/Core/HttpClients and edit CurlHttpClient.php
find
// $curl_opt[CURLOPT_CAINFO] = dirname(dirname(__FILE__)) . "/OAuth/OAuth2/certs/apiintuitcom.pem"; //Pem certification Key Path
change it to
' $curl_opt[CURLOPT_CAINFO] ="/home/folder/public_html/quickbooks_app/resources/cert/cacert.pem";
note: you can put your cacert.pem anywhere just change the address where you link it.
you can get cacert.pem on this site https://curl.haxx.se/docs/caextract.html
Related Topics
PHP SQL Join Together Multiple Tables from Different Databases
Post to a Facebook Page Without "Manage_Pages" Permission Using PHP
PHP to Clean-Up Pasted Microsoft Input
Storing Database Connection in a Session Variable
Format Text in Excel File via PHP
Authorization Header Missing in PHP Post Request
Detecting Ajax in PHP and Making Sure Request Was from My Own Website
Non-Breaking Utf-8 0Xc2A0 Space and Preg_Replace Strange Behaviour
Google Calendar API V3 - Authenticate with Hardcoded Credentials
PHP Pass Function Name as Param Then Call the Function
Count the Number of Pages in a PDF in Only PHP
Executing a Powershell Script from PHP