如何通过TLS 1.2运行django runserver [英] How to run django runserver over TLS 1.2

查看:418
本文介绍了如何通过TLS 1.2运行django runserver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在本地Mac OS X机器上测试Stripe订单。我正在执行此代码:

I'm testing Stripe orders on my local Mac OS X machine. I am implementing this code:

stripe.api_key = settings.STRIPE_SECRET

        order = stripe.Order.create(
          currency = 'usd',
          email = 'j@awesomecom',
          items = [
                    {
                      "type":'sku',
                      "parent":'sku_88F260aQ',
                      "quantity": 1,
                    }
                  ],
          shipping = {
            "name":'Jenny Rosen',
            "address":{
              "line1":'1234 Main Street',
              "city":'Anytown',
              "country":'US',
              "postal_code":'123456'
            }
          },
        )

我收到错误:


条纹不再支持使用TLS 1.0制作的API请求。请
启动与TLS 1.2或更高版本的HTTPS连接。

Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later.

我正在使用django 1.10和python版本2.7.10

I am using django 1.10 and python version 2.7.10

如何强制使用TLS 1.2?我会在python或django一边做这个吗?

How can I force the use of TLS 1.2? Would I do this on the python or django side?

推荐答案

我解决了安装这个库:

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

解决方案来自:


https://github.com/pinax/pinax-stripe/issues/267

这篇关于如何通过TLS 1.2运行django runserver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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