0

I have Packagist set up to provide a local package system for our project, however the local Gitlab server only runs over http://. Where is the composer.json used by Packagist? And is this what I would add?

{
    "config": {
        "secure-http": false
    }
}

For clarity, the error when I attempt to submit a repo to Packagist is:

Uncaught Exception: [Composer\Downloader\TransportException] Your configuration does not allow connections to http://custom-server/custom/repo.git. See https://getcomposer.org/doc/06-config.md#secure-http for details.
James
  • 492
  • 1
  • 6
  • 21

2 Answers2

1

I run through the Packagist source code and found the file which it tries to load (/usr/share/httpd/.composer/config.json). I assume that directory depends on your web server.

So I created this file:

/usr/share/httpd/.composer/config.json 

with content:

{
    "config": {
        "secure-http": false
    }
}
nowaja
  • 79
  • 4
  • An explanation on `why` have you shared this will greatly help, either it from experience or testing it will raise the `quality` of your answer. Cheers :) – Avidos Oct 06 '16 at 23:28
1

Query:

$/opt/cpanel/composer/bin/composer config secure-http

Set false

$/opt/cpanel/composer/bin/composer config secure-http false

Set true

$/opt/cpanel/composer/bin/composer config secure-http true

For details see:

$composer config -h
Shawn C.
  • 6,446
  • 3
  • 34
  • 38
aseire
  • 11
  • 1