我在 Tomcat 6.x 中使用 https。它目前似乎按预期工作。但是,身份验证链中使用的证书即将过期。我假设我需要更新我的 keystore ,以便我的主机证书将继续 像现在这样工作。我的主机证书没有过期,root 也没有过期。中间证书即将过期,我正在寻求有关替换它的帮助。
我第一次在我的 keystore 中安装证书时,我必须完成身份验证链并将所有中间证书放入 keystore 。
在我看来,我认为我应该能够从 keystore 中删除中间证书并使用相同的别名放入新证书。但是,我不知道如何重新创建身份验证链 而且我担心我可能会无意中使主机的证书无效。
所有证书都是 .cer 文件(base64 ascii 文本文件)。我读过其他格式,但只有 .cer 文件类型以及我服务器上的 java 和 tomcat 版本才成功。
如何在不破坏主机和/或其 keystore 的当前有效证书的情况下执行此操作。
如果我没有清楚地表达这些内容; 我不想提交新的 .csr。
涉及的证书:
- 根证书
- 中级 A <-- 这个即将到期
- 中级 B
- 主机证书
我的 keytool 的 list 命令输出的近似值:
keytool -v -list -keystore mykeystore.kdb
Keystore type: jks
Keystore provider: SUN
Your keystore contains 4 entries
Alias name: HostCert
Entry type: keyEntry
Certificate chain length: 4
Certificate[1]:
/** Omitted for brevity: this is the HostCert**/
Certificate[2]:
/** Omitted for brevity: this is the IntermediateB**/
Certificate[3]:
/** Omitted for brevity: this is the IntermediateA**/
Certificate[4]:
/** Ommitted for Brevity this is RootCert **/
*******************************************
*******************************************
Alias name: IntermediateB
Entry type: trustedCertEntry
/** Ommitted for Brevity **/
*******************************************
*******************************************
Alias name: IntermediateA
Entry type: trustedCertEntry
/** Ommitted for Brevity **/
*******************************************
*******************************************
Alias name: RootCert
Entry type: trustedCertEntry
/** Ommitted for Brevity **/
*******************************************
*******************************************
最佳答案
您可以通过在 keytool
命令中指定别名再次导入证书来实现此目的
关于java - 在tomcat中更新证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20918435/