阅读 195

Pycharm requests requests.exceptions.SSLError: HTTPSConnectionPool(host='xx.com.cn', port=443): Max retries exceeded with url: /passport/login (Caused by SSLError(SSLCertVerificationError

使用 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)

 

原文:https://www.cnblogs.com/levia/p/14768036.html

文章分类
代码人生
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐