这是我的 Python 代码:
import requests
requests.get('https://google.com')
这是错误:
requests.exceptions.SSLError: HTTPSConnectionPool(host='google.com', port=443):
Max retries exceeded with url: / (Caused by SSLError(SSLError(1,
'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),))
使用 Insomnia给我一个与证书相关的错误:
我的操作系统是 Windows 7 Professional。
最佳答案
requests.get('https://google.com', verify='/path/to/certfile')
或者您可以通过这样做跳过验证:
requests.get('https://google.com', verify=False)
您应该指定您的 CA。
关于python - 为什么 HTTPS 请求会产生 SSL CERTIFICATE_VERIFY_FAILED 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51768496/