我在开发服务器上遇到了同样的问题。我已经查看了stackoverflow.com/questions/46799365 / ...并且这对我没用。
python -V
Python 2.7.11
当我调用stripe时,我得到了对低于1.2的TLS版本的测试模式请求的支持已被禁用,并且实时模式的支持将在2018年6月13日被删除。请启动HTTPS连接TLS 1.2或更高版本。您可以在https://stripe.com/blog/upgrading-tls了解详情。
我的app.yaml已将ssl设置为"最新" library: - name:django version:" 1.9" - 名称:jinja2版本:" 2.6" - name:markupsafe version:" 0.15" - name:ssl version:latest - name:pycrypto version:latest
我应该用sandbox.py做些什么吗?我认为我的请求是版本2.16.0,因为当它不是时,我遇到了一些其他的环境问题。那是他的罪魁祸首还是其他什么?
这是确切的错误
PermissionError at /
Request req_DrUOViv9FnjhAx: Support for test mode requests made with versions
of TLS lower than 1.2 has been disabled, and support in live mode will be dropped on June 13, 2018. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at https://stripe.com/blog/upgrading-tls.
Request Method:
GET
Request URL:
http://localhost:8080/
Django Version:
1.9.5
Exception Type:
PermissionError
Exception Value:
Request req_DrUOViv9FnjhAx: Support for test mode requests made with versions of TLS lower than 1.2 has been disabled, and support in live mode will be dropped on June 13, 2018. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at https://stripe.com/blog/upgrading-tls.
Exception Location:
lib/stripe/api_requestor.py in handle_error_response, line 178
Python Executable:
/Users/USERNAME/PycharmProjects/PROJECTNAME/virtualenv-dev/bin/python
Python Version:
2.7.11
Python Path:
['/Users/USERNAME/PycharmProjects/PROJECTNAME',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine',
'/Users/USERNAME/PycharmProjects/PROJECTNAME',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine',
'/Users/USERNAME/PycharmProjects/PROJECTNAME/virtualenv/lib/python2.7',
'/Users/USERNAME/PycharmProjects/PROJECTNAME/virtualenv/lib/python2.7/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/django-1.9',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/jinja2-2.6',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/markupsafe-0.15',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/ssl-2.7.11',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/pycrypto-2.6',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/setuptools-0.6c11',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/protorpc-1.0',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/pytz-2017.2',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.3',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/webob-1.1.1',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/werkzeug-0.11.10',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/yaml-3.10',
'lib']
Server time:
Sat, 24 Mar 2018 00:43:28 -0500
答案 0 :(得分:1)
一个月前我花了很多时间在这上面。这是一个巨大的痛苦,但我终于开始工作了。
我遇到的一个问题是Brew使用python版本做了一些非常烦人的事情。它使python v3成为默认值,因此如果你在shell中输入python
,你得到v3而不是v2。我在'/ usr / local / bin'中手动更改了相关的符号链接,使v2成为默认值。
我不记得我采取的所有步骤,但你会希望你的'/ usr / local / bin'看起来像这样:
openssl -> /usr/local/Cellar/openssl/1.0.2n/bin/openssl
pip -> ../Cellar/python/2.7.14_3/bin/pip2
python -> ../Cellar/python/2.7.14_3/bin/python2
然后,您将要删除您的virtualenv并重新创建它们。
请注意,我根本不使用python v3,所以如果你需要v2和v3,那么YMMV。
答案 1 :(得分:0)
除了使用最新的GAE ssl库之外,在本地开发服务器上运行应用程序时,您可能还需要升级本地系统的openssl
库。
来自How do I upgrade my Stripe integration from TLS 1.0 to TLS 1.2?(其他特定操作系统版本另行提及):
- 如果您正在使用任何其他系统,或者已在OS X上使用brew,则需要upgrade your OpenSSL version。
来自How do I upgrade my OpenSSL to support TLS 1.2?(其他特定操作系统版本另行提及):
如果您正在使用任何其他Linux变体,则需要确保这一点 运行
openssl version
给出的版本至少为1.0.1。如果它 没有,你需要采取包更新,可能需要 升级到更新版本的操作系统。
答案 2 :(得分:0)
希望这可以帮助处于这种情况的人....我让我的IT管理员帮助我,这是一个组合的东西,所以我在这里发布解决方案,以避免其他人遭受同样的挫折。< / p>
echo -ne'y \ n'| / usr / bin / ruby -e“$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)” sudo rm -rf / usr / local / Homebrew sudo rm -rf / usr / local / Caskroom sudo rm -rf / usr / local / Cellar
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7 sudo rm -rf“/ Applications / Python 2.7”
ls -l / usr / local / bin | grep'../Library/Frameworks/Python.framework/Versions/2.7'| grep'Cellar' 取消链接&lt; ##删除您找到的##&gt;
echo -ne'y \ n'| / usr / bin / ruby -e“$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
brew install openssl brew postinstall openssl brew link openssl --force
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib / usr / local / lib / ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib / usr / local / lib /
brew install python @ 2 brew postinstall python @ 2 brew link python @ 2 --force
ln -s /usr/local/Cellar/openssl/1.0.2o/bin/openssl / usr / local / bin / openssl ln -s /usr/local/Cellar/openssl/1.0.2o/bin/openssl / usr / local / ssl / bin / openssl ln -s /usr/local/Cellar/python/2.7.14/bin/python / usr / local / bin / python
brew cleanup -s 酿造木桶清理 酿造西梅
python -c'import ssl; print ssl.OPENSSL_VERSION'