-1

For a couple of days now I have trouble using composer. It keeps throwing these errors when downloading a new package, yet a few weeks ago I used composer without a problem.

I have not upgraded anything, not composer, not PHP or anything else, so I cannot say what the problem is.

I simply want to download the devel module via composer require drupal/devel

but then this happens:

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
https://packages.drupal.org/8 could not be fully loaded, package information was loaded from the local cache and may be out of date
Using version ^1.0 for drupal/devel
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
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
https://packages.drupal.org/8 could not be fully loaded, package information was loaded from the local cache and may be out of date
Updating dependencies (including require-dev)

Installation failed, reverting ./composer.json to its original content.


  [Composer\Downloader\TransportException]
  The "https://packages.drupal.org/8/drupal/chosen%2443436dc3d5791cbc3bb366ffeca450e3265c4cbbc1507b404d68ec9bf9d68c4d.json" file could no
  t 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


require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

I saw this post Getting errors in drupal console while installing commerce module via Composer in localhost which has been marked as a duplicate but with no reference to the solution

Using MAMP Pro v3.5 Composer version: 1.5.2 Mac OS: 10.12.6

Does anybody have an idea?

  • I'd recommend you develop inside a VM for more consistent and repeatable results. If you work with MAMP this will be directly on your Mac ("host") and can be harder to fix. With a VM, you can 'throw' it away and start from scratch. Also, it will be isolated from the host software updates. Take a look at puphpet.com and go from there. – therobyouknow Oct 20 '17 at 10:21
  • @therobyouknow I agree with you 100%. I was able to solve this issue. Will write the solution further down. – Martin Oct 23 '17 at 7:50
0

Problem should b solved after updating openssl to latest version. Check: This Issue

| improve this answer | |
  • Did not work :( I have the newest version installed via brew.sh (using OpenSSL 1.0.2l now) and it still does not work. – Martin Oct 18 '17 at 11:31
0

I was able to solve this problem by updating MAMP vom v3.5 to the newest 4 version.

As Mohammad AlQanneh has stated, it has to do with the problem of an old OpenSSL. Pretty much all PHP versions of MAMP v3.5 are bundled / compiled with OpenSSL 0.9.8 and that does not support TLS or the encrypted connection which Drupal's packagist is using.

Upgrading the system's OpenSSL version (for example through brew.sh) does not work, because the old OpenSSL version is compiled with PHP.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.