title: spring boot : How to set spring properties dynamically
body: <p>There are so many properties which can be defined in application.properties of spring boot application.</p>
  
  <p>But I want to pass properties to configure ssl to spring from inside the code. </p>
  
  <pre><code>server.ssl.enabled=true
  # The format used for the keystore 
  server.ssl.key-store-type=PKCS12
  # The path to the keystore containing the certificate
  server.ssl.key-store=keys/keystore.jks
  # The password used to generate the certificate
  server.ssl.key-store-password=changeit
  # The alias mapped to the certificate
  server.ssl.key-alias=tomcat
  </code></pre>
  
  <p>So as these will be spring defined properties to be used from application.properties. I just want to set them from the code based on some logic.</p>
  
  <p>For non spring application, I still have some idea that they can be passed as application, session or context properties but I am not aware on how this works in spring.</p>
  
  <p>Any help would be appreciated.</p>