Python SSL HTTS requests.exceptions.SSLError: HTTPSConnectionPool(host='google.com', port=443)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/51768496/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SSL HTTS requests.exceptions.SSLError: HTTPSConnectionPool(host='google.com', port=443)
提问by rayashi
I don't know why every httpsrequest returns this erros
我不知道为什么每个https请求都返回这个错误
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)'),))
Even in Isomnia give me an error related with certificates
即使在 Isomnia 给我一个与证书相关的错误
My os is Windows 7 Professional.
我的操作系统是 Windows 7 Professional。
回答by Hagai Wild
requests.get('https://google.com', verify='/path/to/certfile')
or you can skip verifications by doing this:
或者您可以通过执行以下操作跳过验证:
requests.get('https://google.com', verify=False)
You should specify your CA.
您应该指定您的 CA。
回答by user13476428
This fixed it: Python referencing old SSL version
这修复了它:Python 引用旧的 SSL 版本
The openssl versions used to differ for python and the one offered by homebrew
用于 python 的 openssl 版本和 homebrew 提供的版本不同
if
brew install python --with-brewd-openssl
doesn't work
trybrew install openssl
brew install python
after uninstalling python
如果
brew install python --with-brewd-openssl
不起作用,请brew install openssl
brew install python
在卸载 python 后尝试