cacert.pem 证书文件应该放在哪里,以便 ddev composer 使用它?出现“证书链中的自签名证书”错误

cacert.pem 证书文件应该放在哪里,以便 ddev composer 使用它?出现“证书链中的自签名证书”错误

我正在使用带有 Ubuntu 的 WSL2,按照以下步骤操作:https://ddev.readthedocs.io/en/stable/users/quickstart/#__tabbed_2_2

当我到达终点线时,ddev composer create "drupal/recommended-project:^9"它失败了无法从 dist 下载 drupal/recommended-project:下载时出现 curl 错误 60https://api.github.com/repos/drupal/recommended-project/zipball/5844800af33c7a774999455d11d6de9307f878d8:SSL 证书问题:证书链中的自签名证书

根据这个问题:https://stackoverflow.com/questions/21187946/curl-error-60-ssl-certificate-issue-self-signed-certificate-in-certificate-cha您需要从这里下载 cacert.pem 文件:https://curl.se/docs/caextract.html我已经这样做了,但是我应该把这个文件放在我的 WSL2/Ubuntu 安装中的哪里呢?我尝试将它复制到 /usr/local/share/ca-certificates,然后运行sudo update-ca-certificates。我还尝试从https://composer.github.io/pubkeys.html,但错误仍然存​​在。

这是我的ddev composer diagnose输出:

➜  my-drupal9-site ddev composer diagnose
Checking platform settings: OK
Checking git settings: OK git version 2.30.2
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://api.github.com/rate_limit: SSL certificate problem: self signed certificate in certificate chain
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading    https://getcomposer.org/versions: SSL certificate problem: self signed certificate in certificate chain
Composer version: 2.6.6
PHP version: 8.1.27
PHP binary path: /usr/bin/php8.1
OpenSSL version: OpenSSL 1.1.1w  11 Sep 2023
cURL version: 7.74.0 libz 1.2.11 ssl OpenSSL/1.1.1w
zip: extension present, unzip present, 7-Zip not available
Composer [diagnose] failed, composer command failed: exit status 2. stderr=
➜  my-drupal9-site   

相关内容