rma.eugene Posted June 10, 2010 Share Posted June 10, 2010 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; ?> Quote Link to comment https://forums.phpfreaks.com/topic/204418-access-secure-files-using-curl/ Share on other sites More sharing options...
sKunKbad Posted June 11, 2010 Share Posted June 11, 2010 You might need to use the curl cookie jar. Try turning on the header and seeing if the script is trying to set a cookie for the auth. Just a guess... Quote Link to comment https://forums.phpfreaks.com/topic/204418-access-secure-files-using-curl/#findComment-1070590 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.