许多 shell 应用程序都抛出了 SSL 证书错误。我不知道是什么原因导致了这种情况。apt
、Google Chrome、Discord 都运行正常。
已经尝试过:证书问题
例子:
YouTube-dl:
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)> (caused by URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))
获得:
ERROR: cannot verify www.google.com's certificate, issued by ‘CN=GTS CA 1O1,O=Google Trust Services,C=US’: Unable to locally verify the issuer's authority. To connect to www.google.com insecurely, use `--no-check-certificate'.
更新:
我的机器上的时间是正确的。(我检查了一下以确保无误)
dpkg -l | grep cert
附带以下软件包:
ii ca-certificates 20180409 all Common CA certificates
ii ca-certificates-java 20180516ubuntu1~18.04.1 all Common CA certificates (JKS keystore)
ii dirmngr 2.2.4-1ubuntu1.2 amd64 GNU privacy guard - network certificate management service
ii python3-certifi 2018.1.18-2 all root certificates for validating SSL certs and verifying TLS hosts (python3)
ii ssl-cert 1.0.39 all simple debconf wrapper for OpenSSL
更新2:
which openssl
成功返回 OpenSSL 已安装在/usr/local/bin/openssl
。
ldd $(which wget)
返回:
linux-vdso.so.1 (0x00007ffda9b23000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f2edddd0000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f2eddbc8000)
libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f2edd9a8000)
libssl.so.1.1 => /usr/local/lib/libssl.so.1.1 (0x00007f2edd710000)
libcrypto.so.1.1 => /usr/local/lib/libcrypto.so.1.1 (0x00007f2edd218000)
libpsl.so.5 => /usr/lib/x86_64-linux-gnu/libpsl.so.5 (0x00007f2edd008000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2edcc10000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2edc9f0000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2ede2d0000)
libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007f2edc670000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2edc468000)
更新 3:
dpkg -l | grep openssl
返回:
ii openssl 1.1.1-1ubuntu2.1~18.04.4 amd64 Secure Sockets Layer toolkit - cryptographic utility
ii perl-openssl-defaults:amd64 3build1 amd64 version compatibility baseline for Perl OpenSSL packages
更新 4:
sudo apt install --reinstall openssl
已解决wget
,但类似的 Python 应用程序youtube-dl
仍在do-release-upgrade
报告证书问题。
结论
重新安装 Ubuntu
答案1
我在使用 Python 的 Ubuntu 上发现的问题是我升级了pip install --upgrade certifi
...然后我花了几个小时才明白为什么事情不起作用......只有当我在这里看到不同的版本时,我才开始朝着正确的方向思考......
vitaliy@vitalnuc01:~/HANAClientsTutorial/python$ dpkg -l | grep python3-certifi
ii python3-certifi 2018.1.18-2 all root certificates for validating SSL certs and verifying TLS hosts (python3)
vitaliy@vitalnuc01:~/HANAClientsTutorial/python$ pip3 search certifi
...
certifi (2020.4.5.1) - Python package for providing Mozilla's CA Bundle.
INSTALLED: 2020.4.5.1 (latest)
...
所以...
pip3 uninstall certifi
sudo apt-get install --reinstall python3-certifi
...基于 Python 的程序又开始为我工作了。
是的,我也差点要重新安装我的 Ubuntu 了 :)