0

I'm trying to use composer to install packages but I get this message :

The "https://packages.drupal.org/8/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Failed to enable crypto
failed to open stream: operation failed

I upgraded my homebrew openssl to the last version but composer seems to use an old installation in MAMP library:

$ which openssl
/Applications/MAMP/Library/bin/openssl
$ openssl version -d
OPENSSLDIR: "/Applications/MAMP/Library/OpenSSL"
$ whereis openssl
/usr/bin/openssl
$ openssl version
OpenSSL 1.0.2j  26 Sep 2016

anyway I get this when I try to reinstall composer:

$ curl -sS https://getcomposer.org/installer | php
Downloading...

Composer (version 1.5.2) successfully installed to: /Volumes/YOM_2/htdocs/composer.phar
Use it: php composer.phar

Some settings on your machine may cause stability issues with Composer.
If you encounter issues, try to change the following:

The OpenSSL library (0.9.8y) used by PHP does not support TLSv1.2 or TLSv1.1.
If possible you should upgrade OpenSSL to version 1.0.1 or above.

How can I make it use the last version? I'm lost... Thank you.

jww
  • 97,681
  • 90
  • 411
  • 885
yom
  • 13
  • 5
  • You will need to rebuild MAMP because OpenSSL will *lack* binary compatibility. Also see [Homebrew refusing to link OpenSSL](http://stackoverflow.com/q/38670295), [Update OpenSSL on OS X with Homebrew](http://stackoverflow.com/q/15185661), [How to install latest version of openssl Mac OS X El Capitan](http://stackoverflow.com/q/35129977), [How to upgrade OpenSSL in OS X?](http://apple.stackexchange.com/q/126830), [Openssl installation using HomeBrew fails](http://superuser.com/q/486389), etc. – jww Oct 05 '17 at 20:07
  • I don't think composer uses MAMPs OpenSSL. Had the same error updating modules using the Drupal 8 UI. Fixed it by upgrading MAMP (free) 3.5 -> 4.2.1. Composer still gives me the same error. So I'm also lost. Is 'php -i | grep OpenSSL' showing the new or old version? – eye-wonder Oct 20 '17 at 11:04

0 Answers0