Support clear text keystore pwd 32/75632/1
authorBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Thu, 10 Jan 2019 15:53:20 +0000 (10:53 -0500)
committerBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Thu, 10 Jan 2019 15:55:29 +0000 (10:55 -0500)
Support clear text keystore pwd

Change-Id: I49580543ebadbe0d578695b01d973e13b2bac9c6
Issue-ID: AAI-2046
Signed-off-by: Bansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
src/main/java/org/onap/aai/datarouter/util/SearchServiceAgent.java

index bbdb4c8..612a40e 100644 (file)
@@ -96,13 +96,14 @@ public class SearchServiceAgent {
                           String documentEndpoint, \r
                           Logger logger) {\r
     \r
+    String deobfuscatedCertPassword = keystorePwd.startsWith("OBF:")?Password.deobfuscate(keystorePwd):keystorePwd;\r
     // Create REST client for search service\r
     searchClient = new RestClient()\r
                     .authenticationMode(RestAuthenticationMode.SSL_CERT)\r
                     .validateServerHostname(false)\r
                     .validateServerCertChain(true)\r
                     .clientCertFile(DataRouterConstants.DR_HOME_AUTH + certName)\r
-                    .clientCertPassword(Password.deobfuscate(keystorePwd))\r
+                    .clientCertPassword(deobfuscatedCertPassword)\r
                     .trustStore(DataRouterConstants.DR_HOME_AUTH + keystore);\r
     \r
     this.searchUrl        = searchUrl;\r