在PC重新配置之后,我无法正确地使用Docker,因为一些curl命令由于SSL/TLS问题而被拒绝。
在一个示例中,curl -vfsSL https://apt.releases.hashicorp.com/gpg
返回以下错误:
* Trying 52.222.214.125:443...
* TCP_NODELAY set
* Connected to apt.releases.hashicorp.com (52.222.214.125) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
经过一番研究,我现在知道这个问题也发生在我的WSL映像中,而不是在主机Windows 上。因此,我认为这一定是源于我的WSL设置的问题,而不是由Docker本身(?)引起的。
关于StackOverflow有很多相关的问题,但我发现没有任何解决方案真正适用于这种情况(而且禁用验证也不是一种选项,这通常是建议的解决方案):
我在一家企业工作,使用IT发布的操作系统。显然,这可能是一个错误的来源,但他们无法帮助我调试这个问题。然而,其中一台是同事的个人电脑,它的工作原理完美无缺。
有什么想法吗?
PC安装程序:
19043.1645
带有Ubuntu-20.04
发布于 2022-08-26 07:06:08
我在我的公司也遇到了类似的问题。问题是我们的防火墙替换了证书。防火墙证书在我的wsl设置中是不可信/未知的。
我通过从(certmgr.msc)导出防火墙证书来解决这个问题。
证书位于“受信任的根证书颁发机构\Certifiactes”
将证书导出为编码为x.509的代码,并将其保存在下面。"D:\eset.cer“。
在您的WSL中,您可以使用以下内容添加证书:
openssl x509 -inform DER -in /mnt/d/eset.cer -out ./eset.crt
sudo cp eset.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates
https://stackoverflow.com/questions/72167566
复制相似问题