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

https_proxy environment variable is ignored when empty #1706

Open
shaicoleman opened this Issue Sep 3, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@shaicoleman

shaicoleman commented Sep 3, 2016

The https_proxy environment variable is ignored when it's empty, and it causes it to download the gem through the http proxy.

# this uses the http_proxy environment variable as a proxy,
# when it should not use a proxy as https_proxy is set but empty
http_proxy='http://1.2.3.4:1234' https_proxy='' gem install rake

This makes it impossible to use a proxy that only supports HTTP requests, but not with HTTPS (e.g. nginx as a forward proxy)

Environment: RubyGems 2.6.6, Ruby 2.3.1p112, Ubuntu 16.04 x64
I will abide by the code of conduct.

@segiddins

This comment has been minimized.

Show comment
Hide comment
@segiddins

segiddins Sep 6, 2016

Member

This appears to be intentional, see

return get_proxy_from_env 'http' if no_env_proxy and _scheme != 'http'

Member

segiddins commented Sep 6, 2016

This appears to be intentional, see

return get_proxy_from_env 'http' if no_env_proxy and _scheme != 'http'

@shaicoleman

This comment has been minimized.

Show comment
Hide comment
@shaicoleman

shaicoleman Sep 7, 2016

if https_proxy is undefined, then it should fallback to http_proxy, but if it's set to empty, it should not use it. That's the way almost all the application work, e.g. curl, apt, wget, etc.

shaicoleman commented Sep 7, 2016

if https_proxy is undefined, then it should fallback to http_proxy, but if it's set to empty, it should not use it. That's the way almost all the application work, e.g. curl, apt, wget, etc.

@bronzdoc

This comment has been minimized.

Show comment
Hide comment
@bronzdoc

bronzdoc Sep 7, 2016

Member

@shaicoleman just to be 100% clear, so what you are asking is: if https_proxy is undefined or is set to an empty string, use http_proxy instead?

Member

bronzdoc commented Sep 7, 2016

@shaicoleman just to be 100% clear, so what you are asking is: if https_proxy is undefined or is set to an empty string, use http_proxy instead?

@shaicoleman

This comment has been minimized.

Show comment
Hide comment
@shaicoleman

shaicoleman Sep 7, 2016

If https_proxy is undefined: https_proxy = http_proxy (current behavior)
if https_proxy is empty: https_proxy = nil (do not use proxy)

shaicoleman commented Sep 7, 2016

If https_proxy is undefined: https_proxy = http_proxy (current behavior)
if https_proxy is empty: https_proxy = nil (do not use proxy)

em- referenced this issue in Thread974/python-phabricator Feb 13, 2017

Frédéric Dalleau
Add proxy support for http and https
If http_proxy or https_proxy environment variable is defined,
feed its content to python's http_client library.
In a shell script, it is possible to assign the proxy :
$ export http_proxy="http://192.168.0.17:3128".

Signed-off-by: Frédéric Dalleau <frederic.dalleau@collabora.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment