【发布时间】:2017-02-04 13:40:33
【问题描述】:
我正在使用Python Stripe package。我收到错误Stripe no longer supports API requests made with TLS 1.0。我在 Mac 上使用 Python 2.7。我该如何解决这个问题?
# Set this to your Stripe secret key (use your test key!)
stripe.api_key = "sk_test_VAjLc9DN9BXMS3GPvFn5W92c"
# Get the credit card details
token = info['stripeToken']
amount = info['amount']
description = info['description']
# Create the charge on Stripe's servers - this will charge the user's card
charge = stripe.Charge.create(
amount=amount,
currency="usd",
card=token,
description=description
)
Traceback (most recent call last):
File "/Users/vertace/Desktop/payableApp-Sumup/payableAppServer.py", line 23, in pay
description=description
File "/Library/Python/2.7/site-packages/stripe/resource.py", line 466, in create
response, api_key = requestor.request('post', url, params, headers)
File "/Library/Python/2.7/site-packages/stripe/api_requestor.py", line 140, in request
resp = self.interpret_response(rbody, rcode, rheaders)
File "/Library/Python/2.7/site-packages/stripe/api_requestor.py", line 288, in interpret_response
self.handle_api_error(rbody, rcode, resp, rheaders)
File "/Library/Python/2.7/site-packages/stripe/api_requestor.py", line 163, in handle_api_error
rheaders)
AuthenticationError: Request req_A4IYdjtgwILuyV: Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at https://stripe.com/blog/upgrading-tls.
【问题讨论】:
-
我正在使用 Xcode 7.2.1。如果我尝试安装 TLS 1.2,它会显示您需要 Xcode 8.2 才能安装 TLS 1.2。但是如果我将我的代码从 xcode 7.2 移动到 xcode 8.2,它会显示错误。我能做什么?