python使用request库报python 使用request报‘requests.exceptions.SSLError: HTTPSConnectionPool(host='ynuf.aliapp.org', port=44’ 提示时这样的,因为我们没有关闭证数验证,关闭证书验证(verify=False))可以解决这个问题或者说是在进行GET时,指定SSL证书.
header= requests.get('http://www.baidu.com/', headers = header, verify=False)
verify:Ture/False,默认是Ture,用于验证SSL证书开关,设置为false,则默认为移除SSL认证,控制台会抛出‘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)’异常
如果,后期报‘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)’错误的话
添加
requests.packages.urllib3.disable_warnings()
header= requests.get('http://www.baidu.com/', headers = header, verify=False)
这是个坑,提示给的是urllib3的使用方法,但程序使用的是requests库,无法解决
就可以解决这个问题