在Mac OSX上启用TLS 1.2 [英] Enable TLS 1.2 on Mac OSX

查看:2166
本文介绍了在Mac OSX上启用TLS 1.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力尝试在OSX 10.12.3的本地计算机上使用与Stripe一起工作的Django应用程序.尝试运行测试付款时出现的错误是:

I am pulling my hair out trying to get a Django application working with Stripe on my local machine with OSX 10.12.3. The error I get when trying to run a test payment is:

/p请求中的

PermissionError请求req_ADIwntj3xGaqUF:条带化 不再支持使用TLS 1.0发出的API请求.请启动HTTPS 与TLS 1.2或更高版本的连接.您可以在以下位置了解更多信息 https://stripe.com/blog/upgrading-tls .

PermissionError at /register Request req_ADIwntj3xGaqUF: 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.

我使用brew成功升级了openssl.当我运行openssl version时,输出为:

I successfully upgraded openssl using brew. When I run openssl version the output is:

OpenSSL 1.0.2k  26 Jan 2017

当我运行which openssl时,输出为:

/usr/local/opt/openssl/bin/openssl

我在堆栈溢出中找到了说可以运行brew link --force openssl的指令.当我这样做时,错误是:

I found instructions on stack overflow that said to run brew link --force openssl. When I do that the error is:

警告:拒绝链接:openssl链接仅用于桶的openssl意味着您 可能最终针对不安全,已弃用的系统OpenSSL进行链接 同时使用来自Homebrew的openssl的标头.相反,传递 编译器的完整include/library路径,例如:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

Warning: Refusing to link: openssl Linking keg-only openssl means you may end up linking against the insecure, deprecated system OpenSSL while using the headers from Homebrew's openssl. Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

有人可以帮助我完成这项工作吗?

Can anybody help me get this working?

推荐答案

问题出在Python环境中,可以尝试的解决方案如下:

The problem’s in the Python environment and the solution to try seems to be the following:

pip install urllib3
pip install pyopenssl
pip install ndg-httpsclient
pip install pyasn1
pip uninstall requests
pip install requests

请参见 https://github.com/pinax/pinax-stripe/issues/267 如何在TLS 1.2上运行django runserver

这一切都假设您运行的是Python 2.7.9+.早期的Python版本不支持TLS 1.2.

That’s all assuming you’re running Python 2.7.9+. Earlier Python versions have no TLS 1.2 support.

这篇关于在Mac OSX上启用TLS 1.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆