diff options
Diffstat (limited to 'adaptors/message-router/consumer/provider/src')
-rwxr-xr-x | adaptors/message-router/consumer/provider/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/provider/impl/AbstractBaseConsumer.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/adaptors/message-router/consumer/provider/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/provider/impl/AbstractBaseConsumer.java b/adaptors/message-router/consumer/provider/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/provider/impl/AbstractBaseConsumer.java index 8937f7b91..7924137ad 100755 --- a/adaptors/message-router/consumer/provider/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/provider/impl/AbstractBaseConsumer.java +++ b/adaptors/message-router/consumer/provider/src/main/java/org/onap/ccsdk/sli/adaptors/messagerouter/consumer/provider/impl/AbstractBaseConsumer.java @@ -36,6 +36,7 @@ import javax.net.ssl.SSLSession; import org.onap.ccsdk.sli.adaptors.messagerouter.consumer.api.ConsumerApi; import org.onap.ccsdk.sli.adaptors.messagerouter.consumer.api.RequestHandler; +import org.onap.ccsdk.sli.core.utils.common.AcceptIpAddressHostNameVerifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -163,15 +164,10 @@ public abstract class AbstractBaseConsumer implements ConsumerApi { httpUrlConnection.setConnectTimeout(connectTimeout); httpUrlConnection.setReadTimeout(readTimeout); - // ignore hostname errors when dealing with HTTPS connections + // Safely ignore hostname errors if host is an ip address or localhost if (httpUrlConnection instanceof HttpsURLConnection) { HttpsURLConnection conn = (HttpsURLConnection) httpUrlConnection; - conn.setHostnameVerifier(new HostnameVerifier() { - @Override - public boolean verify(String arg0, SSLSession arg1) { - return true; - } - }); + conn.setHostnameVerifier(new AcceptIpAddressHostNameVerifier()); } return httpUrlConnection; } |