title: Spring boot SSL/HTTPS using embedded Tomcat setting, best practice on setting password
body: <p>We are currently using embedded Tomcat server for running our Spring boot web app. To enable HTTTPS, we are setting the certificate related configuration in a properties file.  Using pom.xml, we package it:</p>
  
  <pre><code>  mvn clean install -P PT  # DEV, PT, UAT, Staging, DR, PROD
  </code></pre>
  
  <p>We package the code to a WAR file and run the app from the command line using:</p>
  
  <pre><code>  java -jar our-spring-boot-wep.war
  </code></pre>
  
  <p>I have read several online articles on how to configure/enable HTTPS, they all use similar configuration approach as show below, either internally or externally. </p>
  
  <pre><code> # Tomcat connector configuration
   server.tomcat.port=8080
   server.tomcat.ssl.enabled=true
   server.tomcat.ssl.key-alias=cd-something.net
   server.tomcat.ssl.key-store=certificates/cd-something.net.jks
   server.tomcat.ssl.key-password=secret
   server.tomcat.ssl.key-store-type=JKS
   server.tomcat.ssl.trust-store=certificates/trustStore.jks
   server.tomcat.ssl.trust-store-password=secret
  </code></pre>
  
  <p>Is there a way to hide/encrypt those information such as the password? There are several different environments, DEV, PT, UAT, PROD. Each env has its own certificates/JKS file, What is the best practice to configure it?  Thanks!</p>