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')