2017-07-27 110 views
0

不確定這是否是最好的問題,但在2017年6月30日的PayPal TLS 1.2升級後,我無法使用他們的沙箱NVP端點:如預期https://api-3t.sandbox.paypal.com/nvpTLS 1.2升級後PayPal沙箱API SSL錯誤errno 54

活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 

我試圖迫使TLS 1.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和嘗試升級OpenSSL和捲曲的MacPorts與本人取得php70捲曲相同的行爲,這也是最新的使用OpenSSL 1.0.2l。也同後一行爲FreeBSD的機器上使用OpenSSL 1.0.2k快速檢查:

* 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 

任何幫助,非常感謝

+1

你可以用openssl s_client -connect api-3t.sandbox.paypal.com:443 -tls1_2 -servername api-3t.sandbox.payp來排除OpenSSL al.com'。 '-tls1'失敗,而'-tls1_2'成功。 cURL還告訴你,問題出現在其他地方,當它報告*「TLS握手,完成」*。 – jww

回答