Sam
Sam

Reputation: 61

Tomcat KeyStore Environment Path

We have the following example:

< Connector 
           port="8443" maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="${user.home}/.keystore" keystorePass="changeit"
           clientAuth="false" sslProtocol="TLS" />

How can I make the "keystoreFile" point to an environment variable? ${env.CATALINA_HOME}/conf/file.jks doesn't works for me. Thanks.

Upvotes: 6

Views: 9485

Answers (2)

Bohne
Bohne

Reputation: 4047

I know this post is 3 years old....but i ran into the same problem today. So what I found out: tomcat searches the catalina_home as default, so you would just have to say keystoreFile="conf/file.jks" and it will find the keystore at ${env.CATALINA_HOME}/conf/file.jks

Edit: When Starting Tomcat from eclipse this does not work, because the CATALINA_HOME environment variable changes!

Upvotes: 4

Maurice Perry
Maurice Perry

Reputation: 32841

If what you actually want is the value of CATALINA_HOME, there is also a system property ${catalina.home} that you can use.

Upvotes: 2

Related Questions