[英]While running my python code it is giving me error “ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)”
I am currently new with the boto and SSL. 我目前对boto和SSL不熟悉。 I am running a code which creates instances in AWS.
我正在运行在AWS中创建实例的代码。 When I run the code (tried on global and virtual env both) I get the error:
当我运行代码(在全局和虚拟环境中都尝试过)时,出现错误:
self._sslobj.do_handshake() ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)
self._sslobj.do_handshake()ssl.SSLError:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:726)
I checked various posts but none of them work. 我检查了各种职位,但没有一个起作用。 Cross checked my .aws, installed certifi.
交叉检查我的.aws,已安装证书。 Checked openssl:
检查过的openssl:
$ python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 1.0.2o 27 Mar 2018.
Do I need to some how insert openssl in my virtual environment? 我需要一些如何在我的虚拟环境中插入openssl吗?
Edit 1- For the temporary fix 编辑1-对于临时修复
$ export PYTHONHTTPSVERIFY=0
I might be late here. 我可能来晚了。 But for me this helped.
但是对我来说,这有所帮助。
This is an answer to a similar problem by user andilabs!
这是用户andilabs对类似问题的解答!
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
Find out more here : https://stackoverflow.com/a/52172355/3548966 在此处了解更多信息: https : //stackoverflow.com/a/52172355/3548966
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.