When using composer, the following error is displayed :
[Composer\Downloader\TransportException]
The "https://getcomposer.org/version" 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
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries. Therefore the certificate locations SSL_CERT_FILE and SSL_CERT_DIR have not been defined in PHP. This can be tested running the following :
php -r "print_r(openssl_get_cert_locations());"
To fix this issue, OpenSSL can be installed via homebrew.
-
Install homebrew --
ruby -e "$(curl -fsSL --insecure https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Install OpenSSL --
brew install openssl
-
Add the following to your php.ini --
openssl.cafile=/usr/local/etc/openssl/cert.pem