報錯:
/usr/lib/python2.7/site-packages/requests/packages/urllib3/
connectionpool.py:791: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See:
https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
解決辦法
使用requests時,訪問的是https類型的網址,由於https用了ss加密,會報這種insecureplatformwarning,平臺非安全警告,大概與https有關,直接警告信息的網址
https://urllib3.readthedocs.org/en/latest/security.html
在限制urllib3所應用的配置的ssl模塊,在某些Python版本(特別是2.7.9以前的)有限制,特別的是,這致使HTTPS請求在原本更多的功能平臺成功的變成失敗,還有致使某些安全功能模塊失效。
若是你遇到這個警告,強烈建議升級到高版本的python版本,或者在OpenSSL/PyOpenSSL部分描述的,你要使用pyOpenSSL。
操做
yum install python-devel libffi-devel openssl-devel
pip install pyopenssl ndg-httpsclient pyasn1