support reading passwords from environment 76/76076/1
authorBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Mon, 21 Jan 2019 14:48:30 +0000 (09:48 -0500)
committerBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Mon, 21 Jan 2019 14:49:30 +0000 (09:49 -0500)
support reading passwords from environment

Change-Id: I713bddf0e6fa2e8c90de7023c8ca13138fcc1fbe
Issue-ID: AAI-2083
Signed-off-by: Bansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
src/main/java/org/onap/aai/sa/searchdbabstraction/elasticsearch/config/ElasticSearchConfig.java

index f4bc5ef..4680ded 100644 (file)
@@ -209,7 +209,7 @@ public class ElasticSearchConfig {
           if(passwordValue.get().startsWith("OBF:")){
             setTrustStorePassword(Password.deobfuscate(passwordValue.get()));
           }else if(passwordValue.get().startsWith("ENV:")){
-              setTrustStorePassword(System.getProperty(StringUtils.removeStart(passwordValue.get(), "ENV:")));
+              setTrustStorePassword(System.getenv(StringUtils.removeStart(passwordValue.get(), "ENV:")));
           }
           else{
             setTrustStorePassword(passwordValue.get());
@@ -226,7 +226,7 @@ public class ElasticSearchConfig {
           if(passwordValue.get().startsWith("OBF:")){
             setKeyStorePassword(Password.deobfuscate(passwordValue.get()));
           }else if(passwordValue.get().startsWith("ENV:")){
-            setKeyStorePassword(System.getProperty(StringUtils.removeStart(passwordValue.get(), "ENV:")));
+            setKeyStorePassword(System.getenv(StringUtils.removeStart(passwordValue.get(), "ENV:")));
            }
           else{
             setKeyStorePassword(passwordValue.get());