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.
Related
Long story short, I had to reinstall php 7.4 on my Mac. I have a php webapp that hits a .NET API. Prior to the reinstall of php, I was able to hit a locally running version of my API at https://localhost:5001 using cURL in php but now I get a response code of 0 with this error:
Curl error: SSL certificate problem: self signed certificate
If I point the same php code to my production API, everything works fine. I am able to successfully hit the local version of the API with Postman.
I tried the accepted answer from this post but it did not work for me even after restarting apache and my computer. I tried both the php.ini and runtime approaches but neither solved my problem.
You should append the public key of your self signed certificate to the cacert.pem file. Then either of the solutions (setting curl.cainfo in php.ini OR explicitly specifying the path to the cacert.pem file using CURLOPT_CAINFO) proposed here should work just fine.
Make sure you respect the format of the cacert.pem file when adding your public key.
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
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.
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.
I have a problem with wordpress. When I want to do install of some plugin or update Wordpress to new version then I get error:
Download failed. cURL error 77: Problem with the SSL CA cert
Path? Access rights?
I didn't change anything on my website. I have shared hosting.
I have the same issue with OVH and a let's encrypt certificat. This is commun bug while you have a php version to 5.6. it's seems that is working fine with PHP 7.
Both, curl, file_get_contents and getimagesize running a file from my own server didn't work.
I correct the url and make it as a path on a direct URL.
https://example.com/file.css
Become
/home/example.com/file.css
And it works after.
Of course you will need to adapt your scripts with this to detect internal link that can cause the issue.