Caused by SSLError(SSLError

Caused by SSLError(SSLError,第1张

python request https url时报错 (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))

解决方法

1. (verified with Python 3.6.9 on Ubuntu) 忽略ssl认证,加上参数 verify=False

import requests

response = requests.get(“https_url”, verify=False)

2. (not verified) Add the missing certificates yourself when validating. For this you need to include the PEM for the missing chain certificate  and also for the root CA into a file my_trust_store.pem  and then you can call:

requests.get("https://...", verify='my_trust_store.pem')

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/869964.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-13
下一篇2022-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存