Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Curl TLS 1.2升级后的PayPal沙盒API SSL错误错误错误号54_Curl_Paypal_Paypal Sandbox_Tls1.2 - Fatal编程技术网

Curl TLS 1.2升级后的PayPal沙盒API SSL错误错误错误号54

Curl TLS 1.2升级后的PayPal沙盒API SSL错误错误错误号54,curl,paypal,paypal-sandbox,tls1.2,Curl,Paypal,Paypal Sandbox,Tls1.2,不确定这是否是最好的提问地点,但在2017年6月30日对PayPal进行TLS 1.2升级后,我无法使用他们的沙盒NVP端点:https://api-3t.sandbox.paypal.com/nvp 实时APIhttps://api-3t.paypal.com/nvp按预期工作: ~ % curl "https://api-3t.paypal.com/nvp?user=whatever" ACK=Failure&L_ERRORCODE0=81002&L_SHORTMESSAGE

不确定这是否是最好的提问地点,但在2017年6月30日对PayPal进行TLS 1.2升级后,我无法使用他们的沙盒NVP端点:
https://api-3t.sandbox.paypal.com/nvp

实时API
https://api-3t.paypal.com/nvp
按预期工作:

~ % curl "https://api-3t.paypal.com/nvp?user=whatever"
ACK=Failure&L_ERRORCODE0=81002&L_SHORTMESSAGE0=Unspecified%20Method&L_LONGMESSAGE0=Method%20Specified%20is%20not%20Supported&L_SEVERITYCODE0=Error
我从服务器获得一个响应主体

但如果我用沙箱尝试相同的请求,我会得到:

~ % curl "https://api-3t.sandbox.paypal.com/nvp?user=whatever"
curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
我已经尝试了强制TLS1.2和不安全连接的几种组合,但它们没有什么区别。下面是详细的输出:

~ % curl --insecure --tlsv1.2 -v "https://api-3t.sandbox.paypal.com/nvp?user=whatever"
*   Trying 173.0.82.83...
* TCP_NODELAY set
* Connected to api-3t.sandbox.paypal.com (173.0.82.83) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / AES256-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=US; ST=California; L=San Jose; O=PayPal, Inc.; OU=PayPal Production; CN=api-3t.sandbox.paypal.com
*  start date: Jan 14 00:00:00 2016 GMT
*  expire date: Jan 14 23:59:59 2018 GMT
*  issuer: C=US; O=Symantec Corporation; OU=Symantec Trust Network; CN=Symantec Class 3 Secure Server CA - G4
*  SSL certificate verify ok.
> GET /nvp?user=whatever HTTP/1.1
> Host: api-3t.sandbox.paypal.com
> User-Agent: curl/7.54.1
> Accept: */*
>
* OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
* Closing connection 0
curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
我在macOS上,尝试过用MacPorts升级OpenSSL和cURL,我在php70 cURL中得到了相同的行为,它也是OpenSSL 1.0.2l的最新版本。在使用OpenSSL 1.0.2k快速检查FreeBSD机器后,也会出现相同的行为:

* SSL read: error:00000000:lib(0):func(0):reason(0), errno 54
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0
curl: (56) SSL read: error:00000000:lib(0):func(0):reason(0), errno 54

任何帮助都是非常感谢的

通过使用POST而不是GET修复,如中所述 及


还必须以
application/x-www-form-urlencoded

的形式传递我的帖子数据。您可以通过
OpenSSL s_客户端-connect api-3t.sandbox.paypal.com:443-tls1_2-servername api-3t.sandbox.paypal.com
排除OpenSSL<代码>-tls1失败,而
-tls1\u 2
成功。cURL在报告“TLS握手,完成”时还告诉您问题出在其他地方。