If you are on Windows using Xampp, I am stealing a better answer from here, would be helpful if Google shows you this question first.
Download and extract for cacert.pem here (a clean file format/data)
Put it in :
Add this line to your php.ini
curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"
restart your webserver/Apache
I work with xamps nothing of the above did work for me
I tried this and it worked
and change this
$conf[CURLOPT_SSL_VERIFYHOST] = 2; $conf[CURLOPT_SSL_VERIFYPEER] = true;
$conf[CURLOPT_SSL_VERIFYHOST] = 0; $conf[CURLOPT_SSL_VERIFYPEER] = FALSE;
it's a temporary solution if you updated this file the changes will lost
for the essence of development and testing, You have two options to a quick fix
$client = new GuzzleHttp\Client(); $request = $client->request('GET',$url, ['verify' => false]); //where $url is your http address
- follow @Pham Huy Anh answer's above then do this
$client = new GuzzleHttp\Client(); $request = $client->request('GET',$url, ['verify' => 'C:\xampp\php\extras\ssl\cacert.pem']);
Hope it helps someone.
PCI-DSS 3.1 requires all SSL to only TLS 1.2 so a lot of providers are simply turning everything but TLS 1.2 off. I ran into this type of issue where CURL saw the failure to downgrade handshakes as a failure to verify the SSL certificate. Try finding where your code is doing the CURL call and add this line (be sure to replace
$ch with whatever CURL handle your code uses)
curl_setopt($ch, CURLOPT_SSLVERSION, 6); // Force TLS 1.2
it also worked for me by downloading the cert from the link https://gist.github.com/VersatilityWerks/5719158/download then save it in C:\xampp\php\extras\ssl then edit php.ini. To get Php.ini quickly see the figure below enter image description here
Then STOP and reStart your apache again. it worked well !!!