Guzzle certification issue persists - php

I'm trying to post reCaptcha token vie Guzzle but it seems like there is a certification issue. I tried to handle it by myself. I copied cacert.pem into C:\wamp64\bin\php\php7.1.11 folder and changed ;curl.cainfo removed semicolon.
I tried the solution exactly as it was in this question: cURL error 60: SSL certificate in Laravel 5.4
But unfortunately it didn't solve my problem. I'm sure I need to make some rearengements. hope somebody can help with that. This is the error I get:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Laravel 5.4
Php 7.1.11

Related

SSL Error for Sentry v2.10 with Laravel 6.20.27 (PHP v7.4.19)

I am using sentry (version 2.10) with Laravel v6.20.27 and PHP v7.4.19. I follow the same steps mentioned in the documentation (https://docs.sentry.io/platforms/php/guides/laravel/other-versions/laravel5-6/). However I am not able to proceed as I am getting the below error
There was an error sending the event.
SDK: Failed to send the event to Sentry. Reason: "SSL peer certificate or SSH remote key was not OK for "https://oXXXXXXX.ingest.sentry.io/api/XXXXXXXX/store/".".
Please check the error message from the SDK above for further hints about what went wrong.
Please help me to solve this issue.
I faced the same issue on my local. I'm using Laragon on Windows.
I downloaded a new cacert.pem file using this link
Just replace it with the one you currently have in your ssl folder. Hope this will fix your issue.
When you generate SSL certificate, you have to specify the host or server name. If it doesn't match to your real host or server name you see this error.
Check this repo https://gitlab.com/damp-stack/mysql-ssl-docker/-/blob/master/gencerts.sh fake-server should be equal to your server name.

Mailgun PHP API changed on 1/23/2018 SSL Certificate Error not resolved with new cacert.pem file

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 ?
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.
Do we really need to install guzzle to fix this issue? I encounter same issue.
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.
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
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.
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.

how to solve curl error 60:ssl certificate problenm in youtube data api V3?

I am learning to work with youtube data api v3 (using PHP). So I downloaded sample api code and some how i manage to download and install composer in my working directory(version 1.4.x) successfully.
Ater this i run the serach.php script it shows following error
Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\wamp\www\youtube feeds\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187
( ! ) 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) in C:\wamp\www\youtube feeds\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187 .
I am using wamp with php 5.5.12 and apache 2.4.9. Also I enabled curl extension from tray and in php.ini file.
If just starting out, do not try to jump into the deep end.
Start with the "restfull" api side of things.
As an example, you can do this.
$url_link = 'https://www.googleapis.com/youtube/v3/videos?part=snippet&id=[VIDEO_ID]&key=[API_KEY]';
$video = file_get_contents($url_link);
$data= json_decode($video, true);
Then you can grab the required info in that call as you like. Like this
$vid = $data['id'];
LIB's are good for streamlining large programs and code, but not always needed.
The issue is due to a missing "cacert.pem" file (or provided by the host operating system that runs php). This file verifies certificate authorities, so that curl can connect to youtube securely (and know it's youtube, and not a victim of a man in the middle attack).
You cna download these files manually, and specify them in your php ini, but the better option is to use the "certainty" php package to manage these. I would advise using composer, it's very easy to start using.

Laravel 5.2.31 Socialite certificate ssl error

I'm using Socialite for my Facebook login. I was able to follow the steps here until I was able to encouter a cURL certificate error upon clicking the "Continue as ..." on facebook oAuth.
RequestException in CurlFactory.php line 187:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
I have download the cacert.pem and added it to my php.ini by following the steps here.
[cURL]
curl.cainfo=C:\xampp\php\cacert.pem
Restarted apache and still the same error. I'm running it under a Windows machine. What's going on?
I was able to solve this by checking the php path on the environment variables. I needed to add the php path on the path. This is to make sure that the PHP that I am running using php artisan serve is running the correct PHP instance.

uwamp drupal 8 install new module fails

I am getting
Failed to fetch file due to error "cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
error message when I try to install a module in Drupal 8.1.8
I found https://www.drupal.org/node/2654474#comment-11232057 which seems to say it is a problem with my stack, UwAMP. I did not follow the procedure in that post because it indicated it did not fix the problem.
Can someone tell me how to fix this?
Found the solution at https://www.drupal.org/node/2654474#comment-11553625
In my case I had to add a "certs" folder to C:\UwAmp\bin\apache\conf\ then download the cacert.pem to that certs folder. I also had to add "curl.cainfo = C:\UwAmp\bin\apache\conf\certs\cacert.pem" to my php.ini file using the UwAmp GUI.
For the benefit of those of us who are newbies please explain what's happening here and why the solution fixed the problem. Please also explain why there is not some kind of fix to Drupal 8 to prevent this problem from happening.
Thanks!

Categories