简体   繁体   English

Python 错误“NetworkError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:661)

[英]Python error "NetworkError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

How it broke怎么破的

While troubleshooting my command line trying to ssh root@ip into Docker, I seem to I have messed up with openssl , somehow.在对尝试将ssh root@ip到 Docker 中的命令行进行故障排除时,我似乎以某种方式搞砸了openssl

I can now connect to Docker, but I no longer can run scripts which require requests .我现在可以连接到 Docker,但我不能再运行需要requests脚本。

1st attempt第一次尝试

At first I did not know what was wrong.起初我不知道出了什么问题。

If I ran script.py , it would just halt and fail silently.如果我运行script.py ,它只会停止并静默失败。

2nd attempt第二次尝试

Then I tried to run the same script from within a conda env , which has openssl installed, and this time error was verbose, ending with:然后我尝试从安装了opensslconda env运行相同的脚本,这次错误很详细,以:

NetworkError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

openssl upgrade openssl 升级

I have then tried to upgrade it system-wide with brew upgrade openssl , after which I got the following Caveats:然后我尝试使用brew upgrade openssl在系统范围内升级它,之后我得到了以下警告:

A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

and I did it.我做到了。

my .ssh/ has:我的.ssh/有:

github_rsa
github_rsa.pub
id_boot2docker
id_boot2docker.pub
id_rsa
id_rsa.pub
known_hosts

the problem was a library called billboard.py , being imported.问题是一个名为billboard.py的库被导入。

this import was causing the problem and halting the program, and the reason needs further investigation.此导入导致问题并停止程序,原因需要进一步调查。

verbose Error was because conda env did not have all requeriments to run the program.详细错误是因为 conda env 没有运行程序的所有要求。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ConnectionError:HTTPSConnectionPool SSLError(SSLError(1,u&#39;[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:661)&#39;),)) - ConnectionError: HTTPSConnectionPool SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)) Python ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:748) - Python ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748) 错误:Errno 套接字错误] [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:727) - Error: Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727) WordPress Api请求错误:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:700) - WordPress Api request error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:700) Python:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:646) - Python:[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:646) 当我使用 python boto 连接到 aws ec2 时,它显示 SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:661) - When I use python boto connect to aws ec2 , it show SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) 我该如何解决 <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)> 在Python中? - How do I fix <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)> in Python? SSL:CERTIFICATE_VERIFY_FAILED证书验证失败(_ssl.c.661) - SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed (_ssl.c.661) ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:852) - ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852) ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:749) - ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM