信任库初始化 - Tomcat

发布于 2024-11-01 16:41:20 字数 602 浏览 6 评论 0原文

我意识到有很多不同的方法可以为 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 in server.xml
  • JAVA_OPTS variable in catalina.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半城柳色半声笛 2024-11-08 16:41:20

根据 参考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 the javax.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文