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 | |
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')
-rw-r--r-- | champ-service/src/main/bin/start.sh | 9 | ||||
-rw-r--r-- | champ-service/src/main/java/org/onap/champ/ChampApplication.java | 12 |
2 files changed, 20 insertions, 1 deletions
diff --git a/champ-service/src/main/bin/start.sh b/champ-service/src/main/bin/start.sh index 7e6d587..bf29db5 100644 --- a/champ-service/src/main/bin/start.sh +++ b/champ-service/src/main/bin/start.sh @@ -58,6 +58,15 @@ PROPS="-DAPP_HOME=$APP_HOME" PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME" PROPS="$PROPS -Dlogging.config=$APP_HOME/bundleconfig/etc/logback.xml" PROPS="$PROPS -DKEY_STORE_PASSWORD=$KEY_STORE_PASSWORD" + +if [ ! -z "$TRUST_STORE_PASSWORD" ]; then + PROPS="$PROPS -DTRUST_STORE_PASSWORD=${TRUST_STORE_PASSWORD}" +fi + +if [ ! -z "$TRUST_STORE_LOCATION" ]; then + PROPS="$PROPS -DTRUST_STORE_LOCATION=${TRUST_STORE_LOCATION}" +fi + JVM_MAX_HEAP=${MAX_HEAP:-1024} set -x 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); } |