You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WSL环境下Docker无法获取本地颁发者证书问题求助

Windows-WSL-Docker环境下容器内SSL证书验证失败问题

我在Windows-WSL-Docker环境中遇到了容器内的SSL证书验证问题:WSL本身可以正常连接HTTPS URL,但通过Dockerfile构建容器,或者在现有容器内执行需要SSL的命令时,会出现证书验证失败的错误。

比如执行curl -vfsSL https://apt.releases.hashicorp.com/gpg时,返回错误如下:

* Expire in 50 ms for 1 (transfer 0x55b609930110)
* 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.

我已经尝试过以下方法,但都没有效果:

  • 使用--insecure参数跳过证书验证
  • 在Dockerfile构建过程中安装ca-certificates并更新证书

当前使用的Docker版本信息:

  • Docker version 20.10.8, build 3967b7d
  • docker-compose version 1.29.2, build 5becea4c

内容的提问来源于stack exchange,提问作者Gino Pane

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 06:35:26