Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

composer to disable https completely

Tags:

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, ...

like image 271
pajooh Avatar asked Jan 04 '14 13:01

pajooh


People also ask

How do I disable SSL composer?

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.

How do I disable SSL https?

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.

Where is composer cache directory?

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.


2 Answers

composer config --global disable-tls true composer config --global secure-http false 
like image 73
haofly Avatar answered Sep 20 '22 22:09

haofly


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.

like image 32
Gamma.X Avatar answered Sep 18 '22 22:09

Gamma.X