我从PayPal网站获得了一段代码:
// turning off the server and peer verification(TrustManager Concept).
// really paypal??? why not just include a recent cert???
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
Run Code Online (Sandbox Code Playgroud)
正如你在我的评论中所看到的,我想知道为什么在地球上贝宝会禁用这些选项.
我知道(从以前的头痛:))在Windows上,cURL使用过时的证书文件.
但是我的服务器上有一个更新的certs文件,我可以使用它:
curl_setopt($ch, CURLOPT_CAINFO, 'E:\path\to\curl-ca-bundle.crt');
Run Code Online (Sandbox Code Playgroud)
那么为什么PayPal会"推荐"禁用它,如果只需要使用另一个(更新的)证书文件.
那不是更安全吗?
或者我错过了一些东西(我很确定PayPal有足够的钱购买有效证书:p)?
| 归档时间: |
|
| 查看次数: |
2515 次 |
| 最近记录: |