diff options
-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); } |