Hello,
I am trying to post data to a SSL domain using following code:
$URL = "https://myurl:443";
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
if(curl_exec($ch)){
echo "yes";
}else{
echo "No";
}
But, it always echoes no, i.e, curl_exec doesn’t work. I can’t use cert file like here:
curl_setopt($tuCurl, CURLOPT_CAINFO, getcwd() . “/ca.pem”); //from php manual
because i haven’t got one, however SSL certificate is installed. Please suggest me a way to get it done!