I tried these codes, but these does not work.
- Code: Select all
$curl = curl_init('https://www.xxx.com/xxx/xxx/xxx');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
[b]curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,FALSE);[/b]
$page = curl_exec($curl);
curl_close($curl);
print_r($page);
- Code: Select all
$curl = curl_init('https://www.xxx.com/xxx/xxx/xxx');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
[b]curl_setopt ($curl, CURLOPT_CAINFO, 'cacert.pem');[/b]
$page = curl_exec($curl);
curl_close($curl);
print_r($page);
From these link below, I tried saving a cert as .crt
https://curl.haxx.se/ca/cacert.pem
GlobalSign Root CA
==================
-----BEGIN CERTIFICATE-----
blah blah bla
-----END CERTIFICATE-----
and did this below, but it still does not work.
- Code: Select all
curl_setopt($curl, CURLOPT_CAINFO, getcwd() . "GlobalSignRootCA.crt");