在尝试清理我们的项目依赖项时,作曲家失败并出现以下错误:
The "https://packagist.drupal-composer.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
https://packagist.drupal-composer.org could not be fully loaded, package information was loaded from the local cache and may be out of date
这是发生在一个流浪的 CentOS 7 盒子上。
我找到了一个建议下载Mozilla CA证书存储并确保openssl.cafile
在php中设置的答案.ini但这对我不起作用。
我跑wget -v https://packagist.drupal-composer.org/packages.json
看看它从我的本地机器(它工作正常)和流浪盒子返回了什么。流浪箱上的输出是:
--2016-04-24 09:08:30-- https://packagist.drupal-composer.org/packages.json
Resolving packagist.drupal-composer.org... 147.75.205.69
Connecting to packagist.drupal-composer.org|147.75.205.69|:443... connected.
ERROR: cannot verify packagist.drupal-composer.org's certificate, issued by "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3":
Issued certificate not yet valid.
To connect to packagist.drupal-composer.org insecurely, use '--no-check-certificate'.
对我来说,证书因尚未生效而返回似乎很奇怪,直到我意识到输出中的日期偏离了 2 天(今天是 04-26,而不是 04-24)。修复系统时钟后,我重试并能够下载所有依赖项。