aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org')
-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);
}