Keytool 生成的密钥与 Keystore 资源管理器不同

Keytool generates different key than Keystore explorer

我正在学习如何在 wildfly 中设置相互 SSL 的教程: https://github.com/wildfly/quickstart/tree/master/helloworld-mutual-ssl-secured

使用 keytool 密钥生成,一切正常。然后,当我尝试使用通过 KeyStore 资源管理器生成的客户端证书时,当我尝试访问受此安全域保护的应用程序时,我得到 403(未授权)。

我试图找出这两种工具生成的证书或密钥的区别,但找不到。有什么我想念的吗?

更新

似乎 keytool 为 CN 字段生成的 ID 号与 KeyStore Explorer 不同。我从日志中得到消息,解码器找不到标识符 2.5.4.3:

X500 principal [CN=example, OU=asdf, O=asdf, L=asdf, ST=asdf, C=rs] was not decoded - no values of attribute [2.5.4.3]

我在这里找到了答案:https://issues.jboss.org/browse/ELY-1587

所以,我是对的,KeyStore Explorer 生成 UTF8String 类型的 CN 字段,尽管 WF 13 文档声称他们的解码器支持它,但事实并非如此。
他们在 WF 14 中修复了这个错误。

我遇到了类似的问题:我的客户端证书在 Firefox 中无效,但在 Chrome 和 IE 中有效。 Firefox 的问题是证书的字符串在 UTF8String 中编码。使用 PrintableString 重新创建它们是解决方案,请参见此处:

https://superuser.com/questions/1569086/firefox-does-not-offer-client-certificate-ssl-error-handshake-failure-alert