使用 InstallCert.java 下载受信任的证书

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35064673/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 23:41:50  来源:igfitidea点击:

Download trusted Certificate with InstallCert.java

javasecuritysslcertificatessl-certificate

提问by youssef Liouene

I'm trying to add Trusted certificate for many web services deployed in localhost. I find this article: http://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/when you follow the steps in this article, the result will be “jssecacerts” file. In my case I have many servers:

我正在尝试为本地主机中部署的许多 Web 服务添加可信证书。我发现这篇文章:http://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/当您按照本文中的步骤操作时,结果将是“jssecacerts”文件。就我而言,我有很多服务器:

  1. server 1: http://localhost:8181
  2. server 2: http://localhost:8282
  1. 服务器 1:http://localhost:8181
  2. 服务器 2:http://localhost:8282

So, I tried to generate 2 differents files called “jssecacerts_8181” and “jssecacerts_8282”. But this one doesn't work.

因此,我尝试生成 2 个不同的文件,分别称为“jssecacerts_8181”和“jssecacerts_8282”。但是这个不行。

Does the name of the generated file must be "jssecacerts"? How can we add more than one trusted certificate?

生成的文件名一定是“jssecacerts”吗?我们如何添加多个受信任的证书?

采纳答案by Mack

  • Do not change the jssecacerts file name. When you want add more than one trusted certificate you just copy jssecacert from the /jre/lib/security folder (if it is present) to different location .
  • Then run Installcert.java file where jssecacerts file is present (InstallCert and jssecacerts are in same folder).
  • Then that jssecacerts file put into the /jre/lib/security folder.
  • 不要更改 jssecacerts 文件名。当您想要添加多个受信任的证书时,您只需将 jssecacert 从 /jre/lib/security 文件夹(如果存在)复制到不同的位置。
  • 然后运行存在 jssecacerts 文件的 Installcert.java 文件(InstallCert 和 jssecacerts 在同一文件夹中)。
  • 然后将该 jssecacerts 文件放入 /jre/lib/security 文件夹中。

Note : You can add more than one trusted certificate in same jssecacerts file Hope it will work .

注意:您可以在同一个 jssecacerts 文件中添加多个受信任的证书希望它会起作用。

回答by Allahbakash.G

follow the detailed instructions explained below

按照下面解释的详细说明进行操作

https://github.com/escline/InstallCert

https://github.com/escline/InstallCert

once Certificate was added to keystore,restart the tomcat

将证书添加到密钥库后,重新启动 tomcat