Php – The “https://getcomposer.org/versions” file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error: 1416F086

composer-phpPHP

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.

What's going on and how do I fix this?

Best Answer

I have fixed it, the issue you have encountered seems to be related to a missing certificate.

You just need to add your certificate to end of this file:

C:\xampp\apache\bin\curl-ca-bundle.crt

Here's an example how to append the certificate:

-----BEGIN CERTIFICATE-----

MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xvYmFsU2>lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjE... (Your certificate)

-----END CERTIFICATE-----