尝试使用我的沙箱凭据时,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/