问题
I am trying to implement Paypal with IPN (Instant Payment Notification). But as a lot of people here I get this error: "Error SSL certificate problem, verify that the CA cert is OK. Details: error:14090086: SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed"
My page doesn't have an SSL certificate, it is only http. So my first question is: Do I need a SSL certificate? Because I read somewhere that it is not necessary.
I tried downloading SSL bundle file from here: Bundle file and replacing them in php.ini and also in my file.
This is the code:
$ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr'); // change to [...]sandbox.paypal[...] when using sandbox to test
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
// curl_setopt($ch, CURLOPT_CAINFO,'C:\xampp\htdocs\page\cacert.pem');
// curl_setopt($ch, CURLOPT_CAINFO,'C:\xampp\htdocs\page\ca-bundle.crt');
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'));
Is there a way to ignore this error or some other workaround?
来源:https://stackoverflow.com/questions/30709289/paypal-using-ipn-and-ssl