diff --git a/core/src/main/java/org/jclouds/http/HttpConstants.java b/core/src/main/java/org/jclouds/http/HttpConstants.java index 1305cae942..48719e7c1b 100644 --- a/core/src/main/java/org/jclouds/http/HttpConstants.java +++ b/core/src/main/java/org/jclouds/http/HttpConstants.java @@ -24,9 +24,7 @@ package org.jclouds.http; * @author Adrian Cole */ public interface HttpConstants { - public static final String PROPERTY_HTTP_PROXY_ADDRESS = "jclouds.http.proxy.address"; public static final String PROPERTY_HTTP_PROXY_SYSTEM = "jclouds.http.proxy.system"; - public static final String PROPERTY_HTTP_PROXY_PORT = "jclouds.http.proxy.port"; public static final String PROPERTY_HTTP_MAX_RETRIES = "jclouds.http.max-retries"; public static final String PROPERTY_HTTP_MAX_REDIRECTS = "jclouds.http.max-redirects"; public static final String HTTP_HEADERS_LOGGER = "jclouds.http.headers"; diff --git a/core/src/main/java/org/jclouds/http/HttpPropertiesBuilder.java b/core/src/main/java/org/jclouds/http/HttpPropertiesBuilder.java index 3e5fc296ed..44ac2db47e 100755 --- a/core/src/main/java/org/jclouds/http/HttpPropertiesBuilder.java +++ b/core/src/main/java/org/jclouds/http/HttpPropertiesBuilder.java @@ -20,8 +20,6 @@ package org.jclouds.http; import static org.jclouds.http.HttpConstants.PROPERTY_HTTP_MAX_REDIRECTS; import static org.jclouds.http.HttpConstants.PROPERTY_HTTP_MAX_RETRIES; -import static org.jclouds.http.HttpConstants.PROPERTY_HTTP_PROXY_ADDRESS; -import static org.jclouds.http.HttpConstants.PROPERTY_HTTP_PROXY_PORT; import static org.jclouds.http.HttpConstants.PROPERTY_HTTP_PROXY_SYSTEM; import static org.jclouds.http.HttpConstants.PROPERTY_HTTP_RELAX_HOSTNAME; import static org.jclouds.http.pool.PoolConstants.PROPERTY_POOL_IO_WORKER_THREADS; @@ -30,7 +28,6 @@ import static org.jclouds.http.pool.PoolConstants.PROPERTY_POOL_MAX_CONNECTION_R import static org.jclouds.http.pool.PoolConstants.PROPERTY_POOL_MAX_SESSION_FAILURES; import static org.jclouds.http.pool.PoolConstants.PROPERTY_POOL_REQUEST_INVOKER_THREADS; -import java.net.InetAddress; import java.util.Properties; import com.google.common.annotations.VisibleForTesting; @@ -50,21 +47,11 @@ public class HttpPropertiesBuilder { return this; } - public HttpPropertiesBuilder withProxyAddress(InetAddress proxyAddress) { - properties.setProperty(PROPERTY_HTTP_PROXY_ADDRESS, proxyAddress.getHostAddress()); - return this; - } - public HttpPropertiesBuilder useSystemProxies(boolean useSystemProxies) { properties.setProperty(PROPERTY_HTTP_PROXY_SYSTEM, useSystemProxies+""); return this; } - public HttpPropertiesBuilder withProxyPort(int proxyPort) { - properties.setProperty(PROPERTY_HTTP_PROXY_PORT, proxyPort+""); - return this; - } - public HttpPropertiesBuilder withHttpMaxRetries(int httpMaxRetries) { properties.setProperty(PROPERTY_HTTP_MAX_RETRIES, Integer.toString(httpMaxRetries)); return this; diff --git a/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java b/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java index 075fe1d8c5..b6d79c8db9 100644 --- a/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java +++ b/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java @@ -22,16 +22,12 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; -import java.net.InetAddress; -import java.net.InetSocketAddress; import java.net.Proxy; import java.net.ProxySelector; -import java.net.SocketAddress; import java.net.URL; import java.util.Map; import java.util.concurrent.ExecutorService; -import javax.annotation.Nullable; import javax.inject.Named; import javax.inject.Singleton; import javax.net.ssl.HostnameVerifier; @@ -66,22 +62,12 @@ public class JavaUrlHttpCommandExecutorService extends @Named(HttpConstants.PROPERTY_HTTP_RELAX_HOSTNAME) private boolean relaxHostname = false; private final Map sslMap; - + @Inject(optional = true) - @Named(HttpConstants.PROPERTY_HTTP_PROXY_ADDRESS) - @Nullable - private String proxyAddress = System.getProperty("http.proxyHost"); - - @Inject(optional = true) - @Named(HttpConstants.PROPERTY_HTTP_PROXY_ADDRESS) + @Named(HttpConstants.PROPERTY_HTTP_PROXY_SYSTEM) private boolean systemProxies = System.getProperty("java.net.useSystemProxies") != null ? Boolean.parseBoolean(System.getProperty("java.net.useSystemProxies")) : false; - - @Inject(optional = true) - @Named(HttpConstants.PROPERTY_HTTP_PROXY_PORT) - private int proxyPort = System.getProperty("http.proxyPort") != null ? - Integer.parseInt(System.getProperty("http.proxyPort")) : 80; - + @Inject public JavaUrlHttpCommandExecutorService(ExecutorService executorService, DelegatingRetryHandler retryHandler, DelegatingErrorHandler errorHandler, HttpWire wire) { @@ -133,10 +119,6 @@ public class JavaUrlHttpCommandExecutorService extends Iterable proxies = ProxySelector.getDefault().select(request.getEndpoint()); Proxy proxy = Iterables.getLast(proxies); connection = (HttpURLConnection) url.openConnection(proxy); - } else if (proxyAddress != null) { - SocketAddress proxySocketAddress = new InetSocketAddress(InetAddress.getByName(proxyAddress), proxyPort); - Proxy proxy = new Proxy(Proxy.Type.HTTP, proxySocketAddress); - connection = (HttpURLConnection) url.openConnection(proxy); } else { connection = (HttpURLConnection) url.openConnection(); } diff --git a/project/pom.xml b/project/pom.xml index ec2d0c95a9..c2a1927de6 100644 --- a/project/pom.xml +++ b/project/pom.xml @@ -430,16 +430,21 @@ pageTracker._trackPageview(); + + https.noProxyHosts + localhost|10.150.4.49 + + --> file.encoding ${sourceEncoding}