一、SSL问题
1、在你不启用fiddler时,python代码直接发送https请求,不会有SSL问题(也就是说不想看到SSL问题,关掉fiddler就行)
2.启用fiddler会报出以下错误:
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='163.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)')))
verify参数设置
1、Requests的请求默认verify=True
2、如果你将 verify设置为 False,Requests 也能忽略对 SSL 证书的验证
3、但是依然会出现两行Warning,可以不用管
方式1:
import requests requests.packages.urllib3.disable_warnings
方式2:
import warnings warnings.filterwarnings("ignore")
方式3:
import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)