Jump to content

access secure files using cURL


rma.eugene

Recommended Posts

Hey all,

 

Trying to access secured files using cURL.

 

Its a mess, I cant get it to get a file with https.

 

thanks!

 

<?php

$submit_url = "https://na3.salesforce.com/";

$curl = curl_init();

curl_setopt ($curl, CURLOPT_CAINFO, "/php/cacert.pem");

curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, CURLOPT_USERPWD, 'userXX:passXX');
curl_setopt($curl, CURLOPT_SSLVERSION,3);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $submit_url);

$data = curl_exec($curl);

$error = @curl_error($curl);
$info = curl_getinfo($curl);
curl_close($curl);

print_r($info); echo "<hr />" . $error ."<hr />". $data;
?>

 

Link to comment
https://forums.phpfreaks.com/topic/204418-access-secure-files-using-curl/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.