其他分享
首页 > 其他分享> > Pycharm requests requests.exceptions.SSLError: HTTPSConnectionPool(host='xx.com.cn', port=

Pycharm requests requests.exceptions.SSLError: HTTPSConnectionPool(host='xx.com.cn', port=

作者:互联网

使用 python requests 遇到以下错误:
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)
During handling of the above exception, another exception occurred: raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='xx.com.cn', port=443): Max retries exceeded with url: /passport/login
(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))) requests.exceptions.SSLError:
SSL错误, 可以先尝试使用以下方式解决:

1 import  urllib3
2 urllib3.disable_warnings()
session.verify = False
或者
r = requests.post(url, data=body, headers=header, verify=False)

 

标签:retries,certificate,url,verify,urllib3,SSLError,requests
来源: https://www.cnblogs.com/levia/p/14768036.html