gpt4 book ai didi

django - 在 Mac OSX 上启用 TLS 1.2

转载 作者:太空宇宙 更新时间:2023-11-03 12:55:55 25 4
gpt4 key购买 nike

我正在努力尝试让 Django 应用程序在装有 OSX 10.12.3 的本地计算机上与 Stripe 一起工作。我在尝试运行测试付款时遇到的错误是:

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 时,输出是:

OpenSSL 1.0.2k  26 Jan 2017

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

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

我发现关于堆栈溢出的说明说要运行 brew link --force openssl。当我这样做时,错误是:

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

谁能帮我解决这个问题?

最佳答案

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

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/267How to run django runserver over TLS 1.2

这一切都假设您正在运行 Python 2.7.9+。较早的 Python 版本不支持 TLS 1.2。

关于django - 在 Mac OSX 上启用 TLS 1.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42566809/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com