信任库初始化 - Tomcat
我意识到有很多不同的方法可以为 Tomcat 设置信任库。我发现的三种方法是:
server.xml
中的truststoreFile
catalina.sh
中的JAVA_OPTS
变量- 通过代码 通过设置系统属性 (
System.setProperty("javax.net.ssl.trustStore", path);
)
哪种方法具有最高优先级? (如果同时使用所有三个方法加载,哪一个会覆盖其他两个?)根据我的理解,设置属性是默认方法,如果没有这样做,那么它会通过 server.xml.这是正确的吗?
我一直处于一种奇怪的情况,我被迫在我不管理的服务器上工作,并且我认为它们在某个地方有对信任库(我不想使用)的全局引用,但是我想不出任何其他地方可以定义信任库路径。我在服务器上使用 grep 尝试查找单词 trust 或 truststore 的实例,但没有返回任何感兴趣的内容。 Unix 上还有其他地方可以初始化信任存储路径或信息吗?
非常感谢任何帮助。谢谢!
I've realized there are a lot of different methods of setting up a truststore for Tomcat. The three methods I've discovered are:
truststoreFile
inserver.xml
JAVA_OPTS
variable incatalina.sh
- via code by setting the system property (
System.setProperty("javax.net.ssl.trustStore", path);
)
Which method takes the highest precedence? (Which will override the other two if all three methods are loaded used simultaneously?) From my understanding, setting the property is the default method, and if that's not done, then it loads the truststore path via server.xml
. Is this correct?
I've been in a weird situation where I've been forced to work on a server that I don't manage, and I think they have a global reference to a truststore (that I don't want to use) somewhere, but I can't think of any other place where a truststore path will be defined. I used grep on the server to try and find instances of the word trust or truststore, and nothing of interest was returned. Are there any other places on Unix where a trust store path or information could be initialized?
Any help is greatly appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 参考,
truststoreFile 将覆盖您在 catalina.sh、startup.sh、命令行或您启动它的方式中的内容。默认值是 javax.net.ssl.trustStore 系统属性的值,这些方法在启动 Tomcat 之前设置该值。
在代码中设置属性不会产生任何效果,因为在代码运行时连接器已经初始化。
According to the reference,
truststoreFile
will override what you have in catalina.sh, startup.sh, the command line, or however you start it. The default is the value of thejavax.net.ssl.trustStore
system property, which those methods set before starting Tomcat.Setting the property in code won't have any effect because by the time the code runs the Connector will have already been initialized.