cas*_*sen 10 ssl curl ssl-certificate docker tls1.2
重新配置 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.
Run Code Online (Sandbox Code Playgroud)
经过一番挖掘,我现在知道这个问题也出现在我的 WSL 映像中,但不会出现在主机 Windows 操作系统上。因此,我相信这一定是由我的 WSL 设置引起的问题,而不是由 Docker 本身引起的(?)。
StackOverflow 上有很多相关问题,但我发现没有真正适用于这种情况的解决方案(并且它不是禁用验证的选项,这通常是建议的解决方案):
FWIW 我在一家企业工作,使用 IT 发布的操作系统。显然这可能是错误的根源,但他们无法帮助我调试这个问题。然而,在一位同事的电脑上,它运行得毫无问题。
有任何想法吗?
电脑设置:
Luk*_*ner 22
我在我的公司也遇到了类似的问题。问题是我们的防火墙替换了证书。在我的 wsl 设置中,防火墙的证书不受信任/未知。
我通过从 Windows certmanager (certmgr.msc) 导出防火墙证书解决了该问题。
该证书位于“受信任的根证书颁发机构\证书”
将证书导出为 DER 编码 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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16103 次 |
| 最近记录: |