使用 WSL2 后,Docker 容器面临 curl:(60) SSL 证书错误

使用 WSL2 后,Docker 容器面临 curl:(60) SSL 证书错误

在 Windows 10 Pro 中使用基于 WSL2 的引擎之前,我没有遇到任何问题。当我进行更改时,不仅时间始终设置为格林威治(当我创建新容器时),而且即使我将其设置为当前时区,我仍然会收到 curl:(60) SSL 证书问题错误。这与其他 curl:(60) SSL 证书问题不同,因为它可以正常工作。

即使对于简单的curl https://www.github.com,我也会得到相同的结果。

curl -v https://www.github.com
Trying 140.82.121.3:443...
TCP_NODELAY set
Connected to www.github.com (140.82.121.3) 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 (IN), TLS handshake, Encrypted Extensions (8):
TLSv1.3 (IN), TLS handshake, Certificate (11):
TLSv1.3 (OUT), TLS alert, unknown CA (560):
SSL certificate problem: self signed certificate in certificate chain
Closing connection 0
curl: (60) SSL certificate problem: self signed certificate in certificate 
chain
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.

答案1

问题与我的杀毒软件的防火墙有关。退出杀毒软件后一切正常。

相关内容