多证书导入问题
我的应用程序需要与多个安全服务器通信。
我正在使用 keytool 导入证书。
证书导入步骤:
keytool -import -keystore aaa.jks -file aaa.co.uk.cer
keytool -import -keystore bbb.jks -file bbb.co.uk.cer
对于一个证书可以正常工作,但一旦我导入第二个证书,前一个证书就会停止工作。
错误:
Exception:javax.naming.CommunicationException:
simple bind failed: aaa.co.uk:636
[Root exception is javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
我也尝试了以下步骤,但仍然失败:
keytool -import -keystore aaa.jks -alias ms -file aaa.co.uk.cer
keytool -import -alias ms -file bbb.co.uk.cer
我认为我应该将证书附加到一个密钥库中,但不知道该怎么做。
知道怎么做还是我错过了什么?
环境:Java 1.6
应用服务器:Glassfish
My application needs to talk to more than one secure servers.
I am using keytool to import the certificate.
Certificate import steps:
keytool -import -keystore aaa.jks -file aaa.co.uk.cer
keytool -import -keystore bbb.jks -file bbb.co.uk.cer
It works fine with one certificate but as soon as I import the second certificate the previous one stops working.
Error:
Exception:javax.naming.CommunicationException:
simple bind failed: aaa.co.uk:636
[Root exception is javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I also tried the following steps but it's still failing:
keytool -import -keystore aaa.jks -alias ms -file aaa.co.uk.cer
keytool -import -alias ms -file bbb.co.uk.cer
I think I should be appending the certificates in one keystore but don't know how to do it.
Any idea how to do it or am I missing something?
Env: Java 1.6
App Server: Glassfish
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢@BertNase 的建议。
以下导入命令已修复该问题:
现在,此命令将两个证书导入同一密钥库中。
Thanks to @BertNase for suggestion.
The following import command has fixed the issue:
Now, this command imports both certificates in the same keystore.
也许您将两个证书导入到同一个别名?
告诉我们您正在使用的 keytool 命令行以及第二次导入后到底是什么“停止工作”。
Perhaps you import both certificates to the same alias ?
tell us the keytool command line you are using and what exactly 'stops working' after the second import.