(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)')))

requests库提示警告:

 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)')))


 

但移除认证后控制台总是抛出警告:

 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)

根据提示路径https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings可找到方法一些解决办法,简单的办法可用移除警告:disable_warnings()

code

requests.packages.urllib3.disable_warnings()
r = requests.post(service_url, data=payload, headers=self.headers,verify = False)

 

 

 

 

 

 

posted @ 2020-12-30 11:29  anobscureretreat  阅读(2865)  评论(0编辑  收藏  举报