【问题标题】:Curl Request TLS alert, unknown CA in Windows WSL卷曲请求 TLS 警报,Windows WSL 中的未知 CA
【发布时间】:2021-11-20 22:35:56
【问题描述】:

在 wsl 2 窗口中运行此命令会提供以下输出。 谁能解释为什么混合了 TLSv1.3 和 TLSv1.2 IN 和 OUT,这是它无法获得本地颁发者证书的潜在原因。 Windows 主机操作系统是企业版

我已经安装了 ca-certificates 并运行了 update-ca-certificates

curl -v https://google.com:443/
* Trying 172.217.169.78...
* TCP_NODELAY set
* Connected to google.com (172.217.169.78) 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.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (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

【问题讨论】:

    标签: ssl curl windows-subsystem-for-linux tls1.2


    【解决方案1】:

    您是否正在使用受监控或“保护”的网络连接,例如防病毒软件,例如由企业、组织或学校提供的网络连接?如果是这样,您可能会从拦截器中获得假证书/链。

    尝试openssl s_client -connect google.com:443 并查看Certificate chain 下的s:i: 行。 (许多今天的主机需要 SNI 才能正确响应,如果您的 OpenSSL 低于 1.1.1,您需要添加 -servername x 以提供 SNI,但 google 不是其中之一,而且无论如何,因为你的 curl 至少在尝试 1.3,所以它不能是低于 1.1.1 的 OpenSSL。)

    或者,如果从主机 Windows 上的 Chrome、Edge 或 IE(但可能不是 Firefox)连接正常工作,双击挂锁并查看证书链,看看它是否通向 GlobalSign Root CA(就像真正的谷歌那样) 或其他东西(例如 BlueCoat);如果后者,拦截器的根证书安装在您的主机 Windows 商店中,而不是 WSL 系统中。您可以从主机浏览器导出证书并将其放入文件中,然后使用 curl --cacert $file 手动使用它,或者将其导入 WSL 系统的信任库,但这取决于您在 WSL 中运行的系统,而您没有不说。

    添加:日志信息中 TLS 1.3 和 1.2 的混合是可能,因为 1.3 使用与 1.2 相同的记录头版本作为转换黑客,扩展名表明它实际上只是 1.3在两个 Hello 消息中,回调可能不会处理这个。

    【讨论】:

    • 是的,它是一个受监控的业务网络连接。使用 Windows 10 企业版
    猜你喜欢
    • 1970-01-01
    • 2014-11-11
    • 2018-09-20
    • 2019-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多