【问题标题】:Public keys and Keystore don't match公钥和 Keystore 不匹配
【发布时间】:2018-08-30 04:03:13
【问题描述】:

根据这个link,根据接受的答案,其背后的原因是因为 SSL 证书是为完全不同的密钥对生成的。

但我不认为我使用不同的密钥对生成它。

我就是这样做的。

生成密钥库:

keytool -keysize 2048 -genkey -alias tomcat -keyalg RSA -keystore pbsks.keystore

生成 CSR:

keytool -certreq -keyalg RSA -alias tomcat -file csr.csr -keystore pbsks.keystore

使用生成的 csr 请求证书,然后我收到了文件。

导入根ca,中介并颁发证书。

keytool -import -alias root -keystore pbsks.keystore -trustcacerts -file root.crt

keytool -import -alias intermed -keystore pbsks.keystore -trustcacerts -file intermed.crt

keytool -import -alias tomcat -keystore pbsks.keystore -trustcacerts -file issuedcert.crt.pem

为什么会这样?

【问题讨论】:

    标签: java ssl https keystore keytool


    【解决方案1】:

    您正在从 pbsks.keystore 生成密钥和 csr 文件,但您正在将生成的证书导入 tomcat.keystore。

    【讨论】:

    • 其实应该是这样的。
    • 发现问题了,我真的以为pem文件是颁发的证书,但我错了。 Pem 文件是中间证书。
    • 是的,但是我遇到了另一个问题,哈哈。它说连接不安全,但我已经安装了所有证书,没关系。我在想可能是因为我的 CSR 中的域名和通用名称不匹配?
    • 这篇文章可以帮助你:security.stackexchange.com/questions/175786/…
    猜你喜欢
    • 2016-07-28
    • 1970-01-01
    • 2012-06-26
    • 1970-01-01
    • 1970-01-01
    • 2020-07-13
    • 2022-07-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多