Composer update fails with OpenSSL error

Started by casinobet77, February 08, 2018, 03:18:40 PM

Previous topic - Next topic

casinobet77

I'm working on Windows 10 with WAMP 3.0.6 (Apache 2.4.23, PHP 5.6.25) and when I try to run composer update It displays the error with OpenSSL:

Loading composer repositories with package information
The "https://packagist.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.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Updating dependencies (including require-dev)

I have already set openssl.cafile variable in c:\wamp\bin\php\php5.6.25\php.ini and confirmed that this php.ini file is used by CLI.
Output of php -r "var_dump(openssl_get_cert_locations());"

array(8) {
  ["default_cert_file"]=>
  string(25) "c:/usr/local/ssl/cert.pem"
  ["default_cert_file_env"]=>
  string(13) "SSL_CERT_FILE"
  ["default_cert_dir"]=>
  string(22) "c:/usr/local/ssl/certs"
  ["default_cert_dir_env"]=>
  string(12) "SSL_CERT_DIR"
  ["default_private_dir"]=>
  string(24) "c:/usr/local/ssl/private"
  ["default_default_cert_area"]=>
  string(16) "c:/usr/local/ssl"
  ["ini_cafile"]=>
  string(29) "c:/wamp/openssl/cacert.pem"
  ["ini_capath"]=>
  string(16) "c:/wamp/openssl/"
}
I downloaded certificate file from http://curl.haxx.se/ca/cacert.pem and tried to place it to different locations:

c:/wamp/openssl/
c:/usr/local/ssl/certs
c:/usr/local/ssl/cert.pem


I'm working on Windows 10 with WAMP 3.0.6 (Apache 2.4.23, PHP 5.6.25) and when I try to run composer update It displays the error with OpenSSL:

Loading composer repositories with package information
The "https://packagist.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.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Updating dependencies (including require-dev)
I have already set openssl.cafile variable in c:\wamp\bin\php\php5.6.25\php.ini and confirmed that this php.ini file is used by CLI.

Output of php -r "var_dump(openssl_get_cert_locations());"

array(8) {
  ["default_cert_file"]=>
  string(25) "c:/usr/local/ssl/cert.pem"
  ["default_cert_file_env"]=>
  string(13) "SSL_CERT_FILE"
  ["default_cert_dir"]=>
  string(22) "c:/usr/local/ssl/certs"
  ["default_cert_dir_env"]=>
  string(12) "SSL_CERT_DIR"
  ["default_private_dir"]=>
  string(24) "c:/usr/local/ssl/private"
  ["default_default_cert_area"]=>
  string(16) "c:/usr/local/ssl"
  ["ini_cafile"]=>
  string(29) "c:/wamp/openssl/cacert.pem"
  ["ini_capath"]=>
  string(16) "c:/wamp/openssl/"
}
I downloaded certificate file from http://curl.haxx.se/ca/cacert.pem and tried to place it to different locations:

c:/wamp/openssl/ เล่นคาสิโนบนมือถือ
c:/usr/local/ssl/certs
c:/usr/local/ssl/cert.pem
I tried even reinstalling composer, using composer-setup.exe from getcomposer.org but it ends with the same error.

I searched stackoverflow and googled for hours but any of possible solutions have not worked. What am I doing wrong ?

mario

Did you add the cert in php.ini?

openssl.cafile="c:\wamp\openssl\cacert.pem"

and

curl.cainfo="c:\wamp\openssl\cacert.pem"

also make sure curl extension is enabled in your php.ini


if you still have a question please ask again.