diff options
author | Jonathan Platt <jonathan.platt@att.com> | 2021-07-20 10:13:48 -0400 |
---|---|---|
committer | Jonathan Platt <jonathan.platt@att.com> | 2021-07-20 10:13:48 -0400 |
commit | 605fa6cedd43482cb5ca871a8b54f59683f5d560 (patch) | |
tree | 32c7d7a08b5b15e9796b26c6d25141dd8df9b957 | |
parent | 0f1a3db830b43cdf7e366b8a92609187c32370ac (diff) |
Use host name verifier that accepts IP addresses
Modify 'SdncOdlConnection.java' to use a hostname verfier that
handles IP addresses as special cases, so that they can be safely
ignored in lab environments
Issue-ID: SDNC-1497
Signed-off-by: Jonathan Platt <jonathan.platt@att.com>
Change-Id: I73ca672226b055eb7d6896ec260777261f9bb455
-rw-r--r-- | optical-service/provider/src/main/java/org/onap/sdnc/northbound/asyncrequests/SdncOdlConnection.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/optical-service/provider/src/main/java/org/onap/sdnc/northbound/asyncrequests/SdncOdlConnection.java b/optical-service/provider/src/main/java/org/onap/sdnc/northbound/asyncrequests/SdncOdlConnection.java index 860e84bb..accdb4e9 100644 --- a/optical-service/provider/src/main/java/org/onap/sdnc/northbound/asyncrequests/SdncOdlConnection.java +++ b/optical-service/provider/src/main/java/org/onap/sdnc/northbound/asyncrequests/SdncOdlConnection.java @@ -32,6 +32,7 @@ import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; import org.apache.commons.codec.binary.Base64; +import org.onap.ccsdk.sli.core.utils.common.AcceptIpAddressHostNameVerifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -105,12 +106,7 @@ public class SdncOdlConnection { httpConn.setUseCaches(false); if (httpConn instanceof HttpsURLConnection) { - HostnameVerifier hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; + HostnameVerifier hostnameVerifier = new AcceptIpAddressHostNameVerifier(); ((HttpsURLConnection) httpConn).setHostnameVerifier(hostnameVerifier); } |