summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap
diff options
context:
space:
mode:
authorBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>2019-01-08 13:39:32 -0500
committerBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>2019-01-08 13:41:36 -0500
commita11b8dda11186bf9c760fce77d080a4390702566 (patch)
treebecae66bba77fdc5912f40338794a39e8982e278 /src/main/java/org/onap
parentab1a2ed3d961919008bad949e62fcf3ba722c2ce (diff)
set server truststore params as optional
set server truststore params as optional Change-Id: I5f2eba676fa73c59442bf8a809a93328eb0e2051 Issue-ID: AAI-2046 Signed-off-by: Bansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r--src/main/java/org/onap/aai/datarouter/Application.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/org/onap/aai/datarouter/Application.java b/src/main/java/org/onap/aai/datarouter/Application.java
index 42b459d..1a2a5e7 100644
--- a/src/main/java/org/onap/aai/datarouter/Application.java
+++ b/src/main/java/org/onap/aai/datarouter/Application.java
@@ -56,8 +56,20 @@ public class Application extends SpringBootServletInitializer{
if(keyStorePassword==null || keyStorePassword.isEmpty()){
throw new RuntimeException("Env property KEY_STORE_PASSWORD not set");
}
+
HashMap<String, Object> props = new HashMap<>();
- props.put("server.ssl.key-store-password", Password.deobfuscate(keyStorePassword));
+ String deobfuscatedKeyStorePassword = keyStorePassword.startsWith(JETTY_OBFUSCATION_PATTERN)?Password.deobfuscate(keyStorePassword):keyStorePassword;
+ props.put("server.ssl.key-store-password", deobfuscatedKeyStorePassword);
+
+ String trustStoreLocation = System.getenv("TRUST_STORE_LOCATION");
+ String trustStorePassword = System.getenv("TRUST_STORE_PASSWORD");
+ if(trustStoreLocation!=null && trustStorePassword !=null){
+ trustStorePassword = trustStorePassword.startsWith(JETTY_OBFUSCATION_PATTERN)?Password.deobfuscate(trustStorePassword):trustStorePassword;
+ props.put("server.ssl.trust-store", trustStoreLocation);
+ props.put("server.ssl.trust-store-password", trustStorePassword);
+ }
+
+
new Application().configure(new SpringApplicationBuilder(Application.class).properties(props)).run(args);
}