diff --git a/activemq/src/main/java/org/openshift/activemq/discoveryagent/kube/InsecureStreamProvider.java b/activemq/src/main/java/org/openshift/activemq/discoveryagent/kube/InsecureStreamProvider.java index f0e6d30..37fe804 100644 --- a/activemq/src/main/java/org/openshift/activemq/discoveryagent/kube/InsecureStreamProvider.java +++ b/activemq/src/main/java/org/openshift/activemq/discoveryagent/kube/InsecureStreamProvider.java @@ -19,6 +19,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; +import java.net.Proxy; import java.net.URL; import java.net.URLConnection; import java.security.cert.CertificateException; @@ -79,7 +80,7 @@ public URLConnection openConnection(String url, Map headers, int "%s opening connection: url [%s], headers [%s], connectTimeout [%s], readTimeout [%s]", getClass() .getSimpleName(), url, headers, connectTimeout, readTimeout)); } - URLConnection connection = new URL(url).openConnection(); + URLConnection connection = new URL(url).openConnection(Proxy.NO_PROXY); if (headers != null) { for (Map.Entry entry : headers.entrySet()) { connection.addRequestProperty(entry.getKey(), entry.getValue()); diff --git a/common/src/main/java/org/openshift/ping/common/OpenshiftPing.java b/common/src/main/java/org/openshift/ping/common/OpenshiftPing.java index 8e69f6b..cc80223 100644 --- a/common/src/main/java/org/openshift/ping/common/OpenshiftPing.java +++ b/common/src/main/java/org/openshift/ping/common/OpenshiftPing.java @@ -25,6 +25,7 @@ import java.lang.reflect.Method; import java.net.HttpURLConnection; import java.net.InetSocketAddress; +import java.net.Proxy; import java.net.URL; import java.util.Collections; import java.util.List; @@ -274,7 +275,7 @@ public void run() { } HttpURLConnection connection = null; try { - connection = (HttpURLConnection) new URL(url).openConnection(); + connection = (HttpURLConnection) new URL(url).openConnection(Proxy.NO_PROXY); connection.addRequestProperty(Server.CLUSTER_NAME, clusterName); if (_connectTimeout < 0 || _readTimeout < 0) { throw new IllegalArgumentException(String.format( diff --git a/common/src/main/java/org/openshift/ping/common/stream/BaseStreamProvider.java b/common/src/main/java/org/openshift/ping/common/stream/BaseStreamProvider.java index ed46e13..4992d95 100644 --- a/common/src/main/java/org/openshift/ping/common/stream/BaseStreamProvider.java +++ b/common/src/main/java/org/openshift/ping/common/stream/BaseStreamProvider.java @@ -1,6 +1,7 @@ package org.openshift.ping.common.stream; import java.io.IOException; +import java.net.Proxy; import java.net.URL; import java.net.URLConnection; import java.util.Map; @@ -14,7 +15,7 @@ public URLConnection openConnection(String url, Map headers, int if (log.isLoggable(Level.FINE)) { log.log(Level.FINE, String.format("%s opening connection: url [%s], headers [%s], connectTimeout [%s], readTimeout [%s]", getClass().getSimpleName(), url, headers, connectTimeout, readTimeout)); } - URLConnection connection = new URL(url).openConnection(); + URLConnection connection = new URL(url).openConnection(Proxy.NO_PROXY); if (headers != null) { for (Map.Entry entry : headers.entrySet()) { connection.addRequestProperty(entry.getKey(), entry.getValue()); diff --git a/kube/src/test/java/org/openshift/ping/kube/test/ServerTestBase.java b/kube/src/test/java/org/openshift/ping/kube/test/ServerTestBase.java index 103550d..9194fa2 100644 --- a/kube/src/test/java/org/openshift/ping/kube/test/ServerTestBase.java +++ b/kube/src/test/java/org/openshift/ping/kube/test/ServerTestBase.java @@ -21,6 +21,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.net.HttpURLConnection; +import java.net.Proxy; import java.net.URL; import java.util.Arrays; import java.util.Collection; @@ -81,7 +82,7 @@ public void testResponse() throws Exception { Message msg = new Message(null).setFlag(Message.Flag.DONT_BUNDLE) .putHeader(pinger.getId(), hdr).setBuffer(streamableToBuffer(data)); URL url = new URL("http://localhost:8888"); - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY); conn.addRequestProperty(Server.CLUSTER_NAME, TestBase.CLUSTER_NAME); conn.setDoOutput(true); conn.setRequestMethod("POST");