一、问题:
在做接口自动化的时候,报错:
requests.exceptions.SSLError: HTTPSConnectionPool(host='staffssoapi123', port=443): Max retries exceeded with url:
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='staffssoapi123.baid', port=443): Max retries exceeded with url: /login (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))
二、解决办法:
1、在requests请求中,加 :verify=False
ret = requests.post(url, data=json.dumps(params), headers=headers,verify=False).json()
结果:requests发送成功,但是会报warmings
InsecureRequestWarning: Unverified HTTPS request is being made to host 'staffssoa