-#ActiveMQ IP Configurations
-sed -i "s|brokerIp:.*|brokerIp: $SERVICE_IP|" "$main_path/conf/engine-d.yml"
+if [ -f "/opt/app/osaaf/local/org.onap.holmes-engine-mgmt.p12" ]; then
+ KEY_PATH="/opt/app/osaaf/local/org.onap.holmes-engine-mgmt.p12"
+ KEY_PASSWORD=`head -n1 "/opt/app/osaaf/local/mycreds.prop" | cut -d= -f2`
+fi
+
+echo "KEY_PATH=$KEY_PATH"
+echo "KEY_PASS=$KEY_PASSWORD"
+
+#HTTPS Configurations
+sed -i "s|key-store:.*|key-store: $KEY_PATH|" "$main_path/conf/application.yaml"
+sed -i "s|key-store-password:.*|key-store-password: $KEY_PASSWORD|" "$main_path/conf/application.yaml"
+
+if [ "${ENABLE_ENCRYPT}"x = "true"x ]; then
+ sed -i "s|#\?ssl:|ssl:|" "$main_path/conf/application.yaml"
+ sed -i "s|#\?key-store|key-store|" "$main_path/conf/application.yaml"
+ sed -i "s|#\?key-store-password|key-store-password|" "$main_path/conf/application.yaml"
+ sed -i "s|#\?key-store-type|key-store-type|" "$main_path/conf/application.yaml"
+else
+ sed -i 's|#\?ssl:|#ssl:|' "$main_path/conf/application.yaml"
+ sed -i "s|#\?key-store|#key-store|" "$main_path/conf/application.yaml"
+ sed -i "s|#\?key-store-password|#key-store-password|" "$main_path/conf/application.yaml"
+ sed -i "s|#\?key-store-type|#key-store-type|" "$main_path/conf/application.yaml"
+fi