python3.x requests库取消ssl验证,Insec

作者: 旧城城旧 | 来源:发表于2017-10-31 21:01 被阅读98次

    原因

    是因为在请求的时候request.get(url,verify=False)导致的

    错误样子:

    /usr/local/python/lib/python3.5/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
    InsecureRequestWarning)

    解决

    import urllib3
    urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
    就搞定了

    相关文章

      网友评论

        本文标题:python3.x requests库取消ssl验证,Insec

        本文链接:https://www.haomeiwen.com/subject/gwybpxtx.html