From 9b24ce96791d9eb29513f3014d790e8a0f03a1e1 Mon Sep 17 00:00:00 2001 From: "Bansal, Nitin (nb121v)" Date: Fri, 25 Jan 2019 14:06:07 -0500 Subject: align router code with 1.2.1 version of rest c align router code with 1.2.1 version of rest client Change-Id: I3b7c9a5ef804de8247d513b58d3928bc9201e47f Issue-ID: AAI-2120 Signed-off-by: Bansal, Nitin (nb121v) --- pom.xml | 2 +- src/main/java/org/onap/aai/rest/RestClientProducer.java | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 8da4245..7586ca2 100644 --- a/pom.xml +++ b/pom.xml @@ -119,7 +119,7 @@ limitations under the License. org.onap.aai rest-client - 1.1.0 + 1.2.1 diff --git a/src/main/java/org/onap/aai/rest/RestClientProducer.java b/src/main/java/org/onap/aai/rest/RestClientProducer.java index 4170525..5062018 100644 --- a/src/main/java/org/onap/aai/rest/RestClientProducer.java +++ b/src/main/java/org/onap/aai/rest/RestClientProducer.java @@ -27,6 +27,7 @@ import org.onap.aai.event.EventBusConsumer; import org.onap.aai.restclient.client.Headers; import org.onap.aai.restclient.client.OperationResult; import org.onap.aai.restclient.client.RestClient; +import org.onap.aai.restclient.enums.RestAuthenticationMode; import org.onap.aai.restclient.rest.HttpUtil; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; @@ -231,22 +232,21 @@ public class RestClientProducer extends DefaultProducer { private RestClient getRestClient() { if (restClient == null) { - - String keystoreFilename = endpoint.getEcompKeystore(); + String keystorePassword = endpoint.getEcompKeystorePassword(); String clientCertFilename = endpoint.getEcompClientCert(); if (logger.isDebugEnabled()) { logger.debug("Instantiating REST Client with client_cert=" + clientCertFilename - + " keystore=" + keystoreFilename + " keystorePassword=" + keystorePassword); + + " keystorePassword=" + keystorePassword); } String deobfuscatedCertPassword = keystorePassword.startsWith("OBF:")?Password.deobfuscate(keystorePassword):keystorePassword; // Create REST client for search service - restClient = new RestClient().validateServerHostname(false).validateServerCertChain(true) - .clientCertFile(clientCertFilename) - .clientCertPassword(deobfuscatedCertPassword).trustStore(keystoreFilename); + restClient = new RestClient().authenticationMode(RestAuthenticationMode.SSL_CERT).validateServerHostname(false) + .validateServerCertChain(false).clientCertFile(clientCertFilename) + .clientCertPassword(deobfuscatedCertPassword); } return restClient; -- cgit 1.2.3-korg