New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using composer with proxy authentication #5411
Comments
Well, you should configure the |
Thank you for the quick reply, I have configured global environmental variables in windows for http_proxy and https_proxy. Should they be set in composer specifically as well? -Stani From: Christophe Coevoet [mailto:notifications@github.com] Well, you should configure the HTTP_PROXY env variable with the proper settings for your proxy — |
https://getcomposer.org/doc/03-cli.md#http-proxy-or-http-proxy It takes a URL (which in turn can contain a username and password also). |
I have tried but the outcome is the same: $ composer diagnose [Composer\Downloader\TransportException] |
What kind of proxy is it? |
squid From: Rob [mailto:notifications@github.com] What kind of proxy is it? — |
Can anybody help? I have set global environmental variable for http and https_proxy with value our_proxy_ip:port (this proxy requires authentication) this is the output when I run composer create-project --prefer-dist laravel/laravel blog I then tried with and then with this is the output when I set env var http and http_proxy to a proxy with no authentication both proxies with and without authentication are squid proxies. Is it possible to get this working with a proxy which requires authentication? |
I would guess that your proxy setup does not support https. You can force composer to default to http in that case, though that goes against all standard/common recommendations. |
I have the same problem :( @stanislavivanovit did you find a solution? |
@faridmovsumov, not yet. |
The PHP fopen http wrapper don't support proxy authentification with https url... They simply avoid to send http proxy-authentication header setted in http context when send CONNECT method to the proxy... They are only fixed in 5.4.1RC1 : |
Hello there. Try this: I needed put the composer.phar file into the same folder of the project. |
Hello, |
Auto-closing this as it's marked as support request and has not received any update in a long time. |
in composer.php and in Composer/Util/StreamContextFactory.php when read password they use urldecode before base64 encoding...
the password with special char like |
the php stream in ssl use by default STREAM_CRYPTO_METHOD_SSLv23_CLIENT in place of STREAM_CRYPTO_METHOD_TLS_CLIENT in :
this depend on version of openssl you use, but old one you cannot abel to connect on ssl server that refuse sslv2 and v3... on recent version of php (5.6+) you are abel to configure with the context the default protocol but on old one your are not abel to do it...
and the https://getcomposer.org/ as disabled sslv2 and v3... her a rfc about that https://wiki.php.net/rfc/improved-tls-constants in that way you are oblige to use --disable-tls for that... why not use curl extension in place of php stream ? |
Using curl means we would have to depend on yet another extension that is not always installed. |
Make to have the choice to use stream or curl, and eventually use curl or stream by default depending on version of php and presence of the extension. Curl are more simplier to control all aspect of the http request and socket behind... Than stream.... And work better on old php version.... |
This is open source software. We don't have to do anything. But you're welcome to contribute. |
With the following composer.json:
{ ... }
When I run this command:
composer diagnose
I get this output:
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: Warning: Accessing packagist.org over h ttp which is an insecure protocol.
FAIL
[Composer\Downloader\TransportException] The "http://packagist.org/packages.json " file could not be downloaded (HTTP/1.1 407 Proxy Authentication Required)
Checking https connectivity to packagist: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.jso n" file could not be downloaded: failed to open stream: Cannot connect to HTTPS server through proxy
Checking HTTP proxy: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.jso n" file could not be downloaded: failed to open stream: Cannot connect to HTTPS server through proxy
Checking HTTP proxy support for request_fulluri: FAIL
Unable to assess the situation, maybe packagist.org is down (The 'http://packagi st.org/packages.json' URL could not be accessed: HTTP/1.1 400 Bad Request
)
Checking HTTPS proxy support for request_fulluri: FAIL
Unable to assess the situation, maybe github is down (The "https://api.github.co m/repos/Seldaek/jsonlint/zipball/1.0.0" file could not be downloaded: failed to open stream: Cannot connect to HTTPS server through proxy)
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] The "https://api.github.com/rate_limit" file could not be downloaded: failed to open stream: Cannot connect to HTTPS se rver through proxy
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB 723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E32 8C AD90147D AFE50952
OK
Checking composer version:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/versions" file could not be downloaded: failed
to open stream: Cannot connect to HTTPS server through proxy
And I expected this to happen:
We use a proxy which requires authentication, and when we run composer behind that proxy it cannot connect to github.com, packagist.org/.
When we test without authentication everything works, but we wish to use proxy authentication.
Is there a way we can set up composer to use proxy authentication.
and reach the desired outcome: (bellow is the output of the command "composer diagnose" without proxy authentication)
$ composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: Warning: Accessing packagist.org over http which is an insecure protocol.
OK
Checking https connectivity to packagist: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: OK
Checking HTTPS proxy support for request_fulluri: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
?
Thank you
The text was updated successfully, but these errors were encountered: