python问题之requests\packages\urllib3\util\ssl_.py:100: InsecurePlatformWarning
2015-11-04 14:31
876 查看
requests\packages\urllib3\util\ssl_.py:100: 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.
最近在写一下爬虫,前面用flask和jinja2还有python的mysql连接做了下简单的数据交互的登录验证,比起java的struts这样的控制,确实python来的更加简单。
为什么要用python,一次我用java解密一个东西的时候,半天解不出来,base64写起来也是乱七八糟,到java8自带了。后面用了python尝试了下,两行代码。
使用requests时,访问的是https类型的网址,因为https用了ss加密,会报这种insecureplatformwarning,平台非安全警告,大概与https有关,然后查了下解决办法。
直接警告信息的网址 https://urllib3.readthedocs.org/en/latest/security.html
InsecurePlatformWarning
New in version 1.11.
Certain Python platforms (specifically, versions of Python earlier than 2.7.9) have restrictions in their ssl module that limit the configuration that urllib3 can apply. In particular, this can cause HTTPS requests that would succeed on more featureful platforms to fail, and can cause certain security features to be unavailable.
If you encounter this warning, it is strongly recommended you upgrade to a newer Python version, or that you use pyOpenSSL as described in the OpenSSL / PyOpenSSL section.
在限制urllib3所应用的配置的ssl模块,在某些Python版本(特别是2.7.9之前的)有限制,特别的是,这导致HTTPS请求在本来更多的功能平台成功的变成失败,还有导致某些安全功能模块失效。
如果你遇到这个警告,强烈建议升级到高版本的python版本,或者在OpenSSL/PyOpenSSL部分描述的,你要使用pyOpenSSL。
继续查找了一下解决办法:
https://github.com/plotly/plotly.py/issues/339
按照文章的解决办法,使用$ pip install requests[security] 即可,安装完之后不再有警告。
这个将会安装pyOpenSSL,ndg-httpsclient,pyasn1。
用此命令之前,python环境先要安装pip。pip是安装管理python包的工具。
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.
最近在写一下爬虫,前面用flask和jinja2还有python的mysql连接做了下简单的数据交互的登录验证,比起java的struts这样的控制,确实python来的更加简单。
为什么要用python,一次我用java解密一个东西的时候,半天解不出来,base64写起来也是乱七八糟,到java8自带了。后面用了python尝试了下,两行代码。
使用requests时,访问的是https类型的网址,因为https用了ss加密,会报这种insecureplatformwarning,平台非安全警告,大概与https有关,然后查了下解决办法。
直接警告信息的网址 https://urllib3.readthedocs.org/en/latest/security.html
InsecurePlatformWarning
New in version 1.11.
Certain Python platforms (specifically, versions of Python earlier than 2.7.9) have restrictions in their ssl module that limit the configuration that urllib3 can apply. In particular, this can cause HTTPS requests that would succeed on more featureful platforms to fail, and can cause certain security features to be unavailable.
If you encounter this warning, it is strongly recommended you upgrade to a newer Python version, or that you use pyOpenSSL as described in the OpenSSL / PyOpenSSL section.
在限制urllib3所应用的配置的ssl模块,在某些Python版本(特别是2.7.9之前的)有限制,特别的是,这导致HTTPS请求在本来更多的功能平台成功的变成失败,还有导致某些安全功能模块失效。
如果你遇到这个警告,强烈建议升级到高版本的python版本,或者在OpenSSL/PyOpenSSL部分描述的,你要使用pyOpenSSL。
继续查找了一下解决办法:
https://github.com/plotly/plotly.py/issues/339
按照文章的解决办法,使用$ pip install requests[security] 即可,安装完之后不再有警告。
这个将会安装pyOpenSSL,ndg-httpsclient,pyasn1。
用此命令之前,python环境先要安装pip。pip是安装管理python包的工具。
相关文章推荐
- Python的@修饰符和装饰器
- python查看模块文档
- 【python】os模块常用命令
- python os进行文件操作
- python py文件转换成pyc文件
- python导入自定义模块
- 9.python-ini文件使用(读和写)
- python中__name__的解析
- 经典的python代码
- python3用pillow生成验证码,tornado中输出图片
- Python3 官方文档翻译 - 4.7 函数定义
- python re 里面match 和search的区别
- python re 里面match 和search的区别
- 中文文本聚类(切词以及Kmeans聚类)
- Java、PHP、Python与MySQL交互的性能测试
- Python解决中文字符的问题
- python IPYTHON nOTEbOOK
- 升级python到2.7 安装setuptoolos mysqldb
- python 备忘与总结
- hive结合python