Paypal using IPN and SSL

送分小仙女□ 提交于 2019-12-25 05:29:17

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!