Mathieu Dumoulin
Mathieu Dumoulin

Reputation: 12244

Can't update/install using composer behind a corporate firewall

i'm trying to get composer to work on our server but i keep getting issues trying to install/update repositories.

I have configured the environment variables correctly to achieve all this:

http_proxy=http://fastweb.int.bell.ca:8083/
ftp_proxy=ftp://fastweb.int.bell.ca:8083/
HTTP_PROXY_REQUEST_FULLURI=false

I have also forced my composer to use HTTPS protocol only using the configuration directive:

"config": {
    "github-protocols": ["https"]
}

We tried to update the ca_bundle following the post SSL certificate rejected trying to access GitHub over HTTPS behind firewall by setting the GIT_SSL_NO_VERIFY or updating the ca-bundle.crt in /etc/pki/tls/certs...

Nothing seems to work!

Here's the output, it does it for all packages, i tried with and without --prefer-source just to see if it would help, still nothing...

./composer.phar update Loading composer repositories with package
information Updating dependencies (including require-dev)
    - Updating crazycodr/data-transform (dev-master 11f8499 => 2.0.2)
    Checking out 11f8499d0027468705fca72ab67acfbf8ee2e6be

[RuntimeException]   Failed to clone
https://github.com/crazycodr/data-transform.git via git, https and
http protocols, aborting.

- https://github.com/crazycodr/data-transform.git
    fatal: https://github.com/crazycodr/data-transform.git/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?

Upvotes: 3

Views: 4749

Answers (1)

VonC
VonC

Reputation: 1324827

I confirm being able to clone/pull/push a GitHub repo behind a firewall.
And you do need https_proxy in addition of http_proxy:

set http_proxy=http://<login_internet>:<password_internet>@aproxy:aport
set https_proxy=http://<login_internet>:<password_internet>@aproxy:aport
set no_proxy=.company

(the no_proxy part is there to avoid using the proxy for internal url, internal to the company)

Upvotes: 1

Related Questions