Tomcat KeyStore 环境路径
我们有以下示例:
< Connector
port="8443" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="${user.home}/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS" />
如何使“keystoreFile”指向环境变量? ${env.CATALINA_HOME}/conf/file.jks 不适合我。谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这篇文章已经有 3 年历史了……但我今天遇到了同样的问题。所以我发现: tomcat 默认搜索 catalina_home ,所以你只需要说
keystoreFile="conf/file.jks"
它会找到密钥库
${env.CATALINA_HOME}/conf/file.jks
编辑:
当从 eclipse 启动 Tomcat 时,这不起作用,因为 CATALINA_HOME 环境变量发生了变化!
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!
如果您真正想要的是 CATALINA_HOME 的值,还可以使用系统属性 ${catalina.home} 。
If what you actually want is the value of CATALINA_HOME, there is also a system property ${catalina.home} that you can use.