-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Steps to reproduce
- Get an OS X machine running Yosemite and latest a version of PHP from http://php-osx.liip.ch/
- Ensure latest composer is running with
composer selfupdate
- Run
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition
Expected result
- Composer Downloads Magento
Actual result
- Download fails with the composer error "The "https://repo.magento.com/packages.json" file could not be downloaded: Failed to enable crypto"
- Developer silently weeps
Full composer exception below.
After some debugging in Composer, it appears that the SSL/HTTPS implementation on https://repo.magento.com
is incompatible with OS X Yosemite's SSL/HTTPS encryption.
Simplifying the calls composer makes produces similar errors for repo.magento.com
. i.e. this PHP script
$context = stream_context_create();
$contents = file_get_contents('https://repo.magento.com/packages.json', false, $context);
produces the error
PHP Warning: file_get_contents(https://repo.magento.com/packages.json): failed to open stream
I'm sure someone there is already thinking something something Apple's fault. However, this only happens with repo.magento.com
. i.e., I can still update via the Packagist HTTPS server, and my PHP can download an HTTPS packagist packages.json. Again, breaking it down to a simple script -- this works without the failed crypto error.
<?php
$context = stream_context_create();
$contents = file_get_contents('https://packagist.org/packages.json', false, $context);
I realize this is a hard problem to track down, but if The World's Biggest Composer Repository (i.e. the de-facto standard) works with Apple's crypto, it seems like a reasonable expectation that Magento's should do this same.
"Use a VM" is a reasonable suggestion for a work around, but not an acceptable solution to this problem. "Use a mirror" is a reasonable suggestion for a work around, but not an acceptable solution to this problem.
The aforementioned composer exception traces follow.
[Composer\Downloader\TransportException]
The "https://repo.magento.com/packages.json" file could not be downloaded: Failed
to enable crypto
failed to open stream: operation failed
Exception trace:
() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/Util/RemoteFilesystem.php:464
Composer\Util\RemoteFilesystem->get() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/Util/RemoteFilesystem.php:101
Composer\Util\RemoteFilesystem->getContents() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/Repository/ComposerRepository.php:645
Composer\Repository\ComposerRepository->fetchFile() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/Repository/ComposerRepository.php:462
Composer\Repository\ComposerRepository->loadRootServerFile() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/Repository/ComposerRepository.php:256
Composer\Repository\ComposerRepository->hasProviders() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/DependencyResolver/Pool.php:99
Composer\DependencyResolver\Pool->addRepository() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/Command/CreateProjectCommand.php:287
Composer\Command\CreateProjectCommand->installRootPackage() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/Command/CreateProjectCommand.php:156
Composer\Command\CreateProjectCommand->installProject() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/Command/CreateProjectCommand.php:143
Composer\Command\CreateProjectCommand->execute() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/vendor/symfony/console/Command/Command.php:259
Symfony\Component\Console\Command\Command->run() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/vendor/symfony/console/Application.php:844
Symfony\Component\Console\Application->doRunCommand() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/vendor/symfony/console/Application.php:192
Symfony\Component\Console\Application->doRun() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/Console/Application.php:227
Composer\Console\Application->doRun() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/vendor/symfony/console/Application.php:123
Symfony\Component\Console\Application->run() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/src/Composer/Console/Application.php:102
Composer\Console\Application->run() at phar:///Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar/bin/composer:43
require() at /Users/alanstorm/Documents/github_private/GeneralCode/bin/composer.phar:24
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]