Hi, I am getting the SSL exception while uploading file to S3 , Strange thing is i have specified the certificate in the config/filesystems.php in s3 block but it still gives this error.
I tried uploading file to s3 using Curl command line it works fine with the cacerts which i am providing in the filesystem.
Any help will be greatly appreciated, I am not able to pin point the issue as curl command line able to upload file to s3.
Below is Stack Trace
GuzzleHttpExceptionRequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in /var/www/laravel/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:187
Stack trace:
HI Any one else facing this issue with Laravel 5.4 while uploading file to S3. Kindly let me know.
Thanks in Advance.
Gerry
Do you have any example code? Have you tried manually configure Guzzle? If so, Guzzle won't read your laravel settings, so you have to configure them in Guzzle as well.
If you use some sort of integration package (not sure what they are called in case of laravel: bundle, package, module, gem, etc) you should probably check if that one works fine.
Hi
Thanks @sagikazarmark , let me check the option in laravel to pass ssl certificates to guzzle to see if that works.
I'm getting this error with Drupal 8.4.0 as well. But not every time...
php-error staging-4763 [10-Nov-2017 13:08:30 America/Toronto] Uncaught PHP Exception GuzzleHttp\Exception\RequestException: "cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)" at /mnt/www/html/d8esricanadastg/docroot/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 187 request_id="v-27d895be-c642-11e7-9b17-22000a2a779e"
Download the latest cacert.pem from https://curl.haxx.se/ca/cacert.pem
Add the following line to php.ini:
curl.cainfo="/path/to/downloaded/cacert.pem"
I had the same issue.
The solution provided by @pan-christensen did not work for me.
The website on which I was requesting in HTTPS was apparently using a custom(?) SSL certificate.
So, I opened the certificates in chrome and exported all (3) certificates I could: see screenshot
and added them to a custom mycertfile.pem
Then using it with Guzzle this way:
$client = new Client(['verify' => '/my/path/to/mycertfile.pem']);
Now it's working!
You can also download a certificate with the openssl command, but I my case it wasn't the right certificate. So I had to download them manually
You probably want to contact the website owner, as using a self-signed cert and trusting it without verification from the owner is not a good idea. That cert you downloaded could already be part of a man-in-the-middle attach.
@pan-christensen it is right
i have a similare error with kreait of firebase but i use one by one your response but i can't resolve my problem
i configure openssl on my local server
use curl config in php.ini
$serviceAccount = ServiceAccount::fromJsonFile(__DIR__.'/firebaseKey.json');
$firebase = (new Factory)
->withServiceAccount($serviceAccount)
->create();
$database = $firebase->getDatabase();
$ref = $database->getReference('Test');
$key = $ref->push()->getKey();
var_dump(openssl_get_cert_locations());
return $key;
Solution of @pan-christensen worked for me.
in my case, the file descriptors just ran out
Download the latest cacert.pem from https://curl.haxx.se/ca/cacert.pem
Add the following line to php.ini:
curl.cainfo="/path/to/downloaded/cacert.pem"
If you're on Windows and still getting the error after applying the above, make sure you're updating the correct php.ini file.
Run php -i | grep php.ini to print out the path the the ini configuration in use. Have been trying to fix this since last night and turns out I was editing the wrong ini file, smh.
It might not be client problem at all. for me it was the backend.
In my case it was simply wrong intermediate certificate. (the browser downloaded the extra cert silently, but SSLLABS shows me the extra download issue)
Download the latest cacert.pem from https://curl.haxx.se/ca/cacert.pem
Add the following line to php.ini:
curl.cainfo="/path/to/downloaded/cacert.pem"
More info:
https://stackoverflow.com/questions/24611640/curl-60-ssl-certificate-unable-to-get-local-issuer-certificateIf you're on Windows and still getting the error after applying the above, make sure you're updating the correct php.ini file.
Run
php -i | grep php.inito print out the path the the ini configuration in use. Have been trying to fix this since last night and turns out I was editing the wrong ini file, smh.
Thanks for the fix, I was editing the wrong php.ini running WAMP :)
@virgilshelton Thanks it worked great!
Download the latest cacert.pem from https://curl.haxx.se/ca/cacert.pem
Add the following line to php.ini:
curl.cainfo="/path/to/downloaded/cacert.pem"
does anyone knows how to do this in hostinger or hostgator?
$client = new \GuzzleHttp\Client(['verify' => false ]);
Hi here.. there is an FAQ section in docs for this
http://docs.guzzlephp.org/en/stable/faq.html#why-am-i-getting-an-ssl-verification-error
Many solutions have been given to this post. Please note that setting verify to false as stated in the docs it is considered insecure.
I had the same issue.
The solution provided by @pan-christensen did not work for me.
The website on which I was requesting in HTTPS was apparently using a custom(?) SSL certificate.So, I opened the certificates in chrome and exported all (3) certificates I could: see screenshot
and added them to a custommycertfile.pemThen using it with Guzzle this way:
$client = new Client(['verify' => '/my/path/to/mycertfile.pem']);Now it's working!
_You can also download a certificate with the openssl command, but I my case it wasn't the right certificate. So I had to download them manually_
A similar issue was with me, our site is using our own SSL certificate issued by a signing authority. Though it was still valid, one of the intermediate signing authority certificate in the chained bundle was expired. Replacing that certificate in the bundle resolved the issue.
$client = new \GuzzleHttp\Client(['verify' => false ]);
Thank you :)
for laravel 7 use
$response = Http::withoutVerifying()->post('https://www.testwebsite.com')
Most helpful comment
Download the latest cacert.pem from https://curl.haxx.se/ca/cacert.pem
Add the following line to php.ini:
curl.cainfo="/path/to/downloaded/cacert.pem"
More info:
https://stackoverflow.com/questions/24611640/curl-60-ssl-certificate-unable-to-get-local-issuer-certificate