jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Heneveld <notificati...@github.com>
Subject [jclouds] clean up logic and docs for setting proxies (#914)
Date Fri, 05 Feb 2016 15:29:16 GMT
In the absence of any special `jclouds.*proxy*` settings, jclouds should respect the normal
JVM conventions for proxy detection, such as the `java.net.httpProxyHost` property.  For it
to default to no proxy, unlike everything else in java, is surprising.  Previously jclouds
only looked for the JVM proxy if `jclouds.use-system-proxies` was set, and then in a cumbersome

* `jclouds.use-system-proxies` tried to set `java.net.useSystemProxy` but that is read once
at startup and subsequently ignored by the JVM so it had little effect
* so the effect of `jclouds.use-system-proxies` was effectively to tell jclouds to use the
default proxy chosen by the JVM looking at the `java.net.*` properties, *not* necessarily
the OS proxy referred to by `java.net.useSystemProxy`
* the *default* value of `jclouds.use-system-proxies` was taken from `java.net.useSystemProxy`
and so while that succeeds in causing `java.net.useSystemProxy` to take effect, it was succeeding
in a strange accidental way:  the only way for the normal `java.net.httpProxyHost` and others
to take effect was to set `jclouds.use-system-proxies=true` but make sure `java.net.useSystemProxy=false`

This adds explicit control over whether the JVM default proxy is usable (true by default),
and switches the precedence so that if a user specifies a `jclouds.proxy-host` then it is
used -- irrespective of whether any other system proxies or jvm proxies are specified.

I think this is more what a user would expect if they do need to set special proxy settings
for jclouds to use.  More importantly in most cases they can now just set JVM proxy settings
and the right thing will happen.
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * clean up logic and docs for setting proxies
  * ignore .checkstyle files from git and rat

-- File Changes --

    M .gitignore (1)
    M core/src/main/java/org/jclouds/Constants.java (34)
    M core/src/main/java/org/jclouds/proxy/ProxyConfig.java (7)
    M core/src/main/java/org/jclouds/proxy/ProxyForURI.java (26)
    M core/src/main/java/org/jclouds/proxy/internal/GuiceProxyConfig.java (14)
    M core/src/test/java/org/jclouds/proxy/ProxyForURITest.java (48)
    M project/pom.xml (1)

-- Patch Links --


Reply to this email directly or view it on GitHub:

View raw message