【发布时间】:2023-03-14 21:49:02
【问题描述】:
我在 Windows 10 企业版机器上运行 Docker Windows(Linux 容器)。我正在使用基于 Debian 的 Docker 映像,并且我的 Windows 桌面正在运行 ZScaler。
我获得了两个证书文件(一个根证书和一个中间证书),我通过将它们放入 /usr/local/share/ca-certificates 目录并运行出现的“update-ca-certificates”来安装它们安装证书。
当我尝试运行 composer diag 时,我得到以下输出:
composer diag
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: [Composer\Downloader\TransportException] The "https://repo.packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] The "https://api.github.com/rate_limit" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: <Omitted
Dev Public Key Fingerprint: <Omitted
OK
Checking composer version:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
diagnose
有人可以帮我弄清楚如何让它工作吗?
【问题讨论】:
-
为什么要使用自己的证书?
getcomposer.org绝不会使用您的任何个人证书 -
zscaler 充当 SSL 代理,企业要求...它直接将自己置于您和外部世界之间——解密任何出站 SSL 流量并使用自签名证书重新加密它——或至少一份由不受信任的 CA 签署。因此,入站返回 SSL 连接似乎正在使用来自无效 CA 的证书,因此出现错误(这是我的理解)...... getcomposer 文档说它使用 PHP 设置...... PHP 说它使用操作系统设置,还说你应该'不必设置这个......在这里查看相关链接:getcomposer.org/doc/06-config.md#cafile
标签: docker openssl composer-php debian zscaler