diff options
author | Daniel Silverthorn <daniel.silverthorn@amdocs.com> | 2019-01-03 09:17:09 -0500 |
---|---|---|
committer | Daniel Silverthorn <daniel.silverthorn@amdocs.com> | 2019-01-03 09:19:48 -0500 |
commit | 5b2cfce94077e6677da370a7480189f290b466d5 (patch) | |
tree | 8f9533d6d346013db4b13e7178d88c9c1cd4a17b /champ-service/src/main/java/org | |
parent | 6f032db2fc2df0a7fb4de9a09868dd7578139e0c (diff) |
set server truststore params optionally in champ
Change-Id: I20f63834d8bfb3d715d244869e5c1fc4ee9811c9
Issue-ID: AAI-2046
Signed-off-by: Daniel Silverthorn <daniel.silverthorn@amdocs.com>
Diffstat (limited to 'champ-service/src/main/java/org')
-rw-r--r-- | champ-service/src/main/java/org/onap/champ/ChampApplication.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/champ-service/src/main/java/org/onap/champ/ChampApplication.java b/champ-service/src/main/java/org/onap/champ/ChampApplication.java index 06f3ec7..4477006 100644 --- a/champ-service/src/main/java/org/onap/champ/ChampApplication.java +++ b/champ-service/src/main/java/org/onap/champ/ChampApplication.java @@ -45,7 +45,17 @@ public class ChampApplication extends SpringBootServletInitializer { } Map<String, Object> props = new HashMap<>(); - props.put("server.ssl.key-store-password", Password.deobfuscate(keyStorePassword)); + String deobfuscatedKeyStorePassword = keyStorePassword.startsWith("OBF:") ? Password.deobfuscate(keyStorePassword) : keyStorePassword; + props.put("server.ssl.key-store-password", deobfuscatedKeyStorePassword); + + String trustStoreLocation = System.getProperty("TRUST_STORE_LOCATION"); + String trustStorePassword = System.getProperty("TRUST_STORE_PASSWORD"); + if (trustStoreLocation != null && trustStorePassword != null) { + trustStorePassword = trustStorePassword.startsWith("OBF:") ? Password.deobfuscate(trustStorePassword) : trustStorePassword; + props.put("server.ssl.trust-store", trustStoreLocation); + props.put("server.ssl.trust-store-password", trustStorePassword); + } + new ChampApplication().configure(new SpringApplicationBuilder(ChampApplication.class).properties(props)) .run(args); } |