diff options
Diffstat (limited to 'controlloop/common')
-rw-r--r-- | controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java b/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java index 2540cb27a..dae31c39a 100644 --- a/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java +++ b/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java @@ -30,6 +30,7 @@ import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; +import org.apache.http.conn.ssl.NoopHostnameVerifier; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.CloseableHttpClient; @@ -67,7 +68,11 @@ public class RESTManager { logger.debug(body); try (CloseableHttpClient client = - HttpClientBuilder.create().setDefaultCredentialsProvider(credentials).build()) { + HttpClientBuilder + .create() + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .setDefaultCredentialsProvider(credentials) + .build()) { HttpPost post = new HttpPost(url); if (headers != null) { @@ -111,7 +116,11 @@ public class RESTManager { new UsernamePasswordCredentials(username, password)); try (CloseableHttpClient client = - HttpClientBuilder.create().setDefaultCredentialsProvider(credentials).build()) { + HttpClientBuilder + .create() + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .setDefaultCredentialsProvider(credentials) + .build()) { HttpGet get = new HttpGet(url); if (headers != null) { |