Paypal 升级与检测 TLS1.2


原文: https://github.com/paypal/TLS-update

Paypal 最新版必须使用TLS1.2协议连接(TLS1.2 HTTP1.1)。

PHP环境测试方法:

$ php -r '$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://tlstest.paypal.com/"); var_dump(curl_exec($ch));'
  • On success, PayPal_Connection_OK is printed.
  • On failure, bool(false) will be printed.

Python

Python uses the system supplied OpenSSL. TLSv1.2 requires OpenSSL 1.0.1c or higher.

To check Python, in a shell on your production system, run:

For Python 2.x:

$ python -c "import urllib2; print(urllib2.urlopen('https://tlstest.paypal.com/').read())"

For Python 3.x:

$ python -c "import urllib.request; print(urllib.request.urlopen('https://tlstest.paypal.com/').read())"
  • On success, PayPal_Connection_OK is printed.
  • On failure, an URLError will be raised:
    urllib2.URLError: urllib2.URLError:
免备案空间专题