my network does not work well with https, so doing
composer.phar install
throws
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: Failed to enable crypto failed to open stream: operation failed
i used
{ "packagist": false }, { "type": "composer", "url": "http://packagist.org", "options": { "ssl": { "verify_peer": "false" } } }
as a http falback, but again it crashes in some other point:
Installing dependencies - Installing symfony/translation (v2.4.0) Downloading: 100% Downloading: 100% Downloading: 100% [Composer\Downloader\TransportException] The "https://api.github.com/repos/symfony/Translation/zipball/0919e0fc709217f8c9e5049f2603419fdd4a34ff" file could not be downloaded: Failed to enable crypto failed to open stream: operation failed
my problem is just with TLSv1, previous SSL versions should work, as the browsers work correctly.
how should i do, the problem also exists in other cmd tools that depend on https like npm, bower, git, curl, ...
If you can not enable the open ssl extension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true. [Composer\Exception\NoSslException] The openssl extension is required for SSL/TLS protection but is not available.
In the Internet Options window on the Advanced tab, under Settings, scroll down to the Security section. In the Security section, locate the Use SSL and Use TLS options and uncheck Use SSL 3.0 and Use SSL 2.0.
Defaults to C:\Users\<user>\AppData\Local\Composer on Windows, /Users/<user>/Library/Caches/composer on macOS, $XDG_CACHE_HOME/composer on unix systems that follow the XDG Base Directory Specifications, and $COMPOSER_HOME/cache on other unix systems. Stores all the caches used by Composer.
composer config --global disable-tls true composer config --global secure-http false
You can turn off TLS (For your specific project) using your composer.json as such:
{ "require": { "laravel/framework": "5.2.43" }, "config": { "preferred-install": "dist", "disable-tls": true, "secure-http": false } }
NB: Take not of the "disable-tls": true in the config section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With