使用get()时,如何修复SSL证书错误?
我正在运行请求行,如以下内容:
reqs = requests.get('http://test.com')
我正在返回以下错误:
SSLError: HTTPSConnectionPool(host='test.com', port=443): Max retries exceeded with url: /?q=test.org (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))
我尝试了以下内容:
pip install python-certifi-win32
pip install --upgrade certifi
而且似乎都没有用。有人知道如何解决这个问题吗?
I am running a requests line like the following:
reqs = requests.get('http://test.com')
I am being returned the following error:
SSLError: HTTPSConnectionPool(host='test.com', port=443): Max retries exceeded with url: /?q=test.org (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))
I have tried the following:
pip install python-certifi-win32
pip install --upgrade certifi
And neither seem to work. Does anyone know how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊,在这里以评论中的语法重新创建总是很难阅读。
我已经找到了请求库,在本地计算机上进行测试时,我需要将其放在文件的顶部:
Ahh, recreating here as the syntax in the comments is always hard to read.
I've found for the requests library, when testing on the local machine I need to put this at top of file: