python3 urllib3文档_urllib3文档告诉我怎么做?

我正在尝试部署Kilo OpenStack云,但遇到以下错误:Execution of '/usr/bin/openstack token issue --format value' returned

1:

/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90:

InsecurePlatformWarning: A true SSLContext object is not available.

This prevents urllib3 from configuring SSL appropriately and may cause

certain SSL connections to fail. For more information, see

我发现我无法访问比2.7.5更好的python版本,所以我看一下:

所以照他们的建议去做。。。在# pip install pyopenssl ndg-httpsclient pyasn1

/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

InsecurePlatformWarning

You are using pip version 7.1.0, however version 7.1.2 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

Requirement already satisfied (use --upgrade to upgrade): pyopenssl in /usr/lib64/python2.7/site-packages

Collecting ndg-httpsclient

/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

InsecurePlatformWarning

Downloading ndg_httpsclient-0.4.0.tar.gz

Requirement already satisfied (use --upgrade to upgrade): pyasn1 in /usr/lib/python2.7/site-packages

Installing collected packages: ndg-httpsclient

Running setup.py install for ndg-httpsclient

Successfully installed ndg-httpsclient-0.4.0

也可以这样说:Once the packages are installed, you can tell urllib3 to switch the

ssl backend to PyOpenSSL with inject_into_urllib3():

import urllib3.contrib.pyopenssl

urllib3.contrib.pyopenssl.inject_into_urllib3() Now you can continue

using urllib3 as you normally would.

我不明白那是什么意思?有一些python源代码我需要去补丁吗?在

更新:

我按照约瑟普的建议做了这件事:

^{pr2}$

但是我已经安装了pyopenssl。。。在# pip install pyopenssl

Requirement already satisfied (use --upgrade to upgrade): pyopenssl in /usr/lib64/python2.7/site-packages

更新:

如果我这样做会发生什么。。。在# python

Python 2.7.5 (default, Jun 24 2015, 00:41:19)

[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import OpenSSL

>>> import urllib3

>>> import urllib3.contrib.pyopenssl as pyopenssl

>>> pyopenssl.inject_into_urllib3()

>>>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值