在电脑重新配置后,我无法正确使用Docker,因为一些curl命令由于SSL/TLS问题而被拒绝。例如,
经过一番调查,我现在知道这个问题也出现在我的WSL映像中,但在主机Windows操作系统上没有出现。因此,我认为这必须是源于我的WSL设置的问题,而不是Docker本身引起的问题(?)。
StackOverflow上有很多相关的问题,但我发现没有一个解决方案真正适用于这种情况(而禁用验证通常是一个建议的解决方案,这并不可行):
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设置:
- Windows 10企业版
- 版本:21H1
- OS构建版本:19043.1645
- Windows功能体验包:120.2212.4170.0
- WSL 2与Ubuntu-20.04
- Docker Desktop 4.7.1(77678),使用基于WSL 2的引擎
curl -V
是否显示为libcurl/{ver} Schannel
(而不是openssl、gnutls或nss)?如果是这样,可能是因为你的计算机上有AV/ES,或者企业网络中有WAF/DLP等拦截你的流量,并使用推送到Windows存储中但Ubuntu未知的根证书。在浏览器中,如果你访问(虚拟)顶级页面https://apt.releases.hashicorp.com/
并查看证书链,它是Amazon CA 1B
和Amazon Root CA 1
还是其他内容? - dave_thompson_085