I am setting up a PayPal IPN script. I used the sample code from PayPal. Here is a portion:
- Code: Select all
$ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
// In wamp like environments that do not come bundled with root authority certificates,
// please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set the directory path
// of the certificate as shown below.
// curl_setopt($ch, CURLOPT_CAINFO, dirname('cecert.pem') . 'cacert.pem');
if( !($res = curl_exec($ch)) ) {
error_log("Got " . curl_error($ch) . " when processing IPN data",3,"IPNError.txt");
curl_close($ch);
exit;
}
curl_close($ch);
When I run it as is I get the following error:
when processing IPN dataGot SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed when processing IPN data
When I run it by trying to specify the cacert.pem file with the line:
curl_setopt($ch, CURLOPT_CAINFO, dirname('cecert.pem') . 'cacert.pem');
I get the following error:
Got error setting certificate verify locations:
CAfile: .cacert.pem
CApath: none
Can you shed some light on these errors? I do have and SSL certificate setup on server and I am useing a Windows server running II6.
Maybe easiest to address the second error first. If I can get the location correct it might fix the first error.
Dan

