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)

 

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

上一篇:vue创建项目运行报错Error: Cannot find module 'E:\@vue\cli-service\bin\vue-cli-service.js'


下一篇:html禁止清除input文本输入缓存的两种方法