Question

Php curl_exec works here: http://membership.oqmhandbook.com/order.php

but same code doesn't work here: http://wecallyouleads.com/order.php

any help would be appreciated..!!

my code is

$dsc_msg = '[my xml request]';

$dsc_header = array("POST /send/interchange HTTP/1.1",
   "Host: lightning.instascreen.net",
   "Content-Type: text/xml, charset=utf-8‏",
   "SOAPAction: \"https://lightning.instascreen.net/send/interchange\""
  );

  $ch = curl_init("https://lightning.instascreen.net/send/interchange");
  if ($ch == FALSE) {
   echo "Connecting to createsend failed\n";
  }
  curl_setopt($ch, CURLOPT_HTTPHEADER, $dsc_header);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $dsc_msg);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  curl_setopt($ch, CURLOPT_VERBOSE, 0);    

  $result = curl_exec($ch);
  echo "Return XML:\n$result\n";
Was it helpful?

Solution

From your error message, it looks like it is attempting to verify the SSL (which it absolutely should), but it cannot. Really, to fix this, you need to make sure the SSL is in proper order.

If you absolutely cannot, you can try adding in this to see if it makes a difference.

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

This is not really good practice and this article on how doing stuff like this makes cURL the most dangerous code in the world is really good. Scroll down to section 7 (on page 7 of the PDF) for some good examples of what NOT To do.

The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top