From 01058306bbd691ff507e2e0b7cc13848520b1a85 Mon Sep 17 00:00:00 2001 From: BT2983 Date: Tue, 18 Sep 2018 18:57:28 -0600 Subject: naming ms - interface testing updates. Added additional configurable properties for interfaces, and to work with no certificates or https. Change-Id: I680b10ce21c41cecf6c32ddbbcb1c33967fff2e0 Issue-ID: CCSDK-342 Signed-off-by: BT2983 --- .../apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ms/neng/src/main/java') diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java index 392567b7..e93675bf 100644 --- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java +++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java @@ -27,7 +27,9 @@ import java.security.cert.X509Certificate; import java.util.List; import java.util.Map; import java.util.logging.Logger; +import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.conn.ssl.TrustStrategy; import org.apache.http.impl.client.CloseableHttpClient; @@ -142,7 +144,8 @@ public class PolicyFinderServiceImpl implements PolicyFinder { TrustStrategy acceptingTrustStrategy = (X509Certificate[] chain, String authType) -> true; SSLContext sslContext = org.apache.http.ssl.SSLContexts.custom() .loadTrustMaterial(null, acceptingTrustStrategy).build(); - SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext); + HostnameVerifier verifier = (String arg0, SSLSession arg1) -> true; + SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext, verifier); CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(csf).build(); HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); requestFactory.setHttpClient(httpClient); -- cgit 1.2.3-korg