1
votes

I'm trying to install composer on Windows but I get the following error:

The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:

error: 1416F086: SSL routines: tls_process_server_certificate: certificate verify failed Failed to enable crypto failed to open stream: operation failed

2
Possible duplicate of Composer install failed - Nico Haase

2 Answers

1
votes

Use Command and check certificate is exists or not:

php -r "print_r(openssl_get_cert_locations());"

You will get Output like this :

Array (

[default_cert_file] => /Applications/XAMPP/xamppfiles/share/openssl/cert.pem [default_cert_file_env] => SSL_CERT_FILE [default_cert_dir] => /Applications/XAMPP/xamppfiles/share/openssl/certs [default_cert_dir_env] => SSL_CERT_DIR [default_private_dir] =>/Applications/XAMPP/xamppfiles/share/openssl/private [default_default_cert_area] =>/Applications/XAMPP/xamppfiles/share/openssl [ini_cafile] => [ini_capath] => )

Check :

cert.pem file exists or not.

-1
votes

For me disabling the Antivirus solved the issue

  • Disable Antivirus
  • Close the terminal
  • Reopen the Terminal and type "composer diagnose" to check if problem is solved.
  • Re-enable Antivirus