curl - Paypal REST API 沙箱 - SSL 连接错误

标签 curl paypal paypal-sandbox

尝试使用我的沙箱凭据时,API 失败。但是,如果我使用 live,它工作正常。由于这个问题,无法运行测试交易。

[root@host]# curl -v https://api.sandbox.paypal.com/v1/oauth2/token -H "Accept: application/json"-H "Accept-Language: en_US"-u "[removed]:[removed]"-d "grant_type=client_credentials"* 即将连接()到 api.sandbox.paypal.com端口 443 (#0) * 尝试 173.0.82.78...已连接 * 连接到 api.sandbox.paypal.com (173.0.82.78) 端口 443 (#0) * 使用证书路径初始化 NSS:sql:/etc/pki/nssdb * CA文件:/etc/pki/tls/certs/ca-bundle.crt CA路径:无 * NSS 错误-12286 * 关闭连接#0 * SSL 连接错误 curl: (35) SSL 连接错误

最佳答案

Curl 错误 35 意味着 SSL 初始握手甚至没有通过,因为 Paypal 返回的响应没有显示为有效的 SSL。例如,如果您尝试连接到端口 80,这不是您的情况,就会发生这种情况。但是,您确实到达了 Paypal 服务器。问题不是 CAfile,因为您还没有达到验证签名的状态。如果收到证书,则证书本身不被认为是有效的。错误 NSS 12286 是:

"Cannot communicate securely with peer: no common encryption algorithm(s)."

The local and remote systems share no cipher suites in common. This can be due to a misconfiguration at either end. It can be due to a server being misconfigured to use a non-RSA certificate with the RSA key exchange algorithm.

它说“没有通用的加密算法”,但 Paypal 甚至没有发回一些密码。我刚刚尝试了您的代码,它对我来说非常好用。如果错误是缺少 CA 证书,您会看到握手、打招呼,然后是“SSL 证书问题:无法获取本地颁发者证书”。

如果我有更多的声誉,我会只写评论。这个问题真的应该由 Paypal 的人来解决。

关于curl - Paypal REST API 沙箱 - SSL 连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43403772/

相关文章:

ruby - 如何将curl 的输出读入ruby 变量?

php - 由于 cURL 和 SSL,社交 API 无法正常工作

linux - 在 linux 命令行中使用 curl --data 上传 cURL http post 文件

php - PayPal ExpressCheckout (Payflow) : Invalid vendor accountError Code: 26

paypal - Moodle Paypal_enrolment 插件不适用于 Paypal 沙盒?

php - paypal-php-sdk 中的 PayPal-Mock-Response

javascript - PayPal Express Checkout,提供 input_fields 时出错

php - 通过带有客户端身份验证的 SSL 进行 curl

paypal - 每个 PayPal IPN 中发送什么变量?

php - 在网上商店快速结帐后,我如何进入 Paypal 确认付款? PHP