align router code with 1.2.1 version of rest c 65/76365/1
authorBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Fri, 25 Jan 2019 19:06:07 +0000 (14:06 -0500)
committerBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Fri, 25 Jan 2019 19:08:00 +0000 (14:08 -0500)
align router code with 1.2.1 version of rest client

Change-Id: I3b7c9a5ef804de8247d513b58d3928bc9201e47f
Issue-ID: AAI-2120
Signed-off-by: Bansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
pom.xml
src/main/java/org/onap/aai/rest/RestClientProducer.java

diff --git a/pom.xml b/pom.xml
index 8da4245..7586ca2 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -119,7 +119,7 @@ limitations under the License.
       <dependency>
          <groupId>org.onap.aai</groupId>
          <artifactId>rest-client</artifactId>
-         <version>1.1.0</version>
+         <version>1.2.1</version>
       </dependency>
       <!-- End REST Client specific dependencies. -->
       <!-- testing -->
index 4170525..5062018 100644 (file)
@@ -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;