diff options
Diffstat (limited to 'adaptors/mdsal-resource')
-rw-r--r-- | adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/RestService.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/RestService.java b/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/RestService.java index ebddc24ae..7f90ab43d 100644 --- a/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/RestService.java +++ b/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/RestService.java @@ -22,6 +22,7 @@ package org.onap.ccsdk.sli.adaptors.resource.mdsal; import org.apache.commons.codec.binary.Base64; +import org.onap.ccsdk.sli.core.utils.common.AcceptIpAddressHostNameVerifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -90,8 +91,8 @@ public class RestService { try { HttpURLConnection conn = getRestConnection(fullUrl, method); if (conn instanceof HttpsURLConnection) { - HostnameVerifier hostnameVerifier = (hostname, session) -> true; - ((HttpsURLConnection) conn).setHostnameVerifier(hostnameVerifier); + // Safely disable host name verification if host is an IP address or 'localhost' + ((HttpsURLConnection) conn).setHostnameVerifier(new AcceptIpAddressHostNameVerifier()); } // Write message |