https with CURL problem.

Problems with the Windows version of XAMPP, questions, comments, and anything related.

https with CURL problem.

Postby anishgiri » 05. April 2016 06:23

I am using xampp 1.7.1 on windows 7. My extension=php_openssl.dll is uncommented. I can't get to work my curl with a url that has https.

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");
anishgiri
 
Posts: 1
Joined: 05. April 2016 06:08
XAMPP version: 1.7.1
Operating System: windows server 2003

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 58 guests