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')
当使用Python的requests库访问HTTPS网址时,如果遇到SSL证书验证失败的问题,可以尝试两种方法解决:一是忽略SSL认证,通过设置`verify=False`参数;二是自行添加缺失的证书到信任存储,需要包含PEM格式的中间证书和根证书。这些方法可以帮助你继续进行HTTPS请求。

3205

被折叠的 条评论
为什么被折叠?



