Unable to establish SSL connection with Composer with PHP 5.6.3

After cloning the repository on Ubuntu 14.04 with PHP 5.6.3, I cannot run php composer.phar selfupdate nor php composer.phar update . I get this message:

  [Composer\Downloader\TransportException] The "https://getcomposer.org/version" file could not be downloaded: SSL ope ration 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 

I think that the problem should be with certificates that I have locally, but I can’t imagine how to fix this.

Here is the composer .json:

 { "name": "zendframework/skeleton-application", "description": "Skeleton Application for ZF2", "license": "BSD-3-Clause", "keywords": [ "framework", "zf2" ], "homepage": "http://framework.zend.com/", "require": { "php": ">=5.3.3", "zendframework/zendframework": "2.3.*", "evandotpro/edp-module-layouts": "1.*", "tecnick.com/tcpdf": " ~6.0@stable ", "phpoffice/phpexcel": "1.7.*" }, "require-dev": { "phpunit/phpunit": "4.1.*", "phpunit/phpunit-selenium": ">=1.2" }, "autoload": { "psr-0": {"BOZA\\": "vendor/BOZA/"}, "classmap": ["vendor/tecnick.com/tcpdf"] } 
+5
source share
3 answers

One reason for this may be that certificates are missing or not found by PHP.

Is ca-certificates installed?

If not: apt-get install ca-certificates or just download the certificate bundle from here:

Then check and edit php.ini to use these certificates for the SSL connection made by PHP.

 curl.cainfo=/path/to/ssl/certs/ca-bundle.crt openssl.cafile=/path/to/ssl/certs/ca-bundle.crt 
+9
source

You can downlode this pem file:

http://curl.haxx.se/ca/cacert.pem

then find it in php.ini, for example:

 openssl.cafile=/usr/local/etc/openssl/cacert.pem 

ref: http://akrabat.com/ssl-certificate-verification-on-php-5-6/

0
source

For a similar ssl connection error

error: 14090086: SSL procedures: SSL3_GET_SERVER_CERTIFICATE: certificate

Here , as I decided it.

0
source

Source: https://habr.com/ru/post/1212455/


All Articles