Composer错误:14090086:SSL例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败

时间:2016-04-26 19:58:15

标签: php drupal openssl composer-php

在尝试清理drupal和项目依赖项时,composer失败并出现错误:

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盒子上发生的。

1 个答案:

答案 0 :(得分:1)

我发现有一个answer建议下载Mozilla CA certificate store,并确保在php.ini中设置了openssl.cafile,但这对我没有用。

我跑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)。在修复系统时钟后,我重试并能够下载所有依赖项。