0

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 ?

Jaimez
  • 1
  • 1
  • Sounds more like an error with the certificate itself, rather than where it is? https://stackoverflow.com/questions/17084886/ssl-error-routinesssl3-get-server-certificatecertificate-verify-failed – Andy Jul 31 '17 at 10:17
  • Possible duplicate of [file\_get\_contents(): SSL operation failed with code 1. And more](https://stackoverflow.com/questions/26148701/file-get-contents-ssl-operation-failed-with-code-1-and-more) – Nawin Jul 31 '17 at 10:18

1 Answers1

0

Try to unset https_proxy enables composer to work!

Chandra Kumar
  • 4,127
  • 1
  • 17
  • 25