我有一个从我的 CAS 服务器重定向到的 Web 应用程序。但我得到了这个异常(exception):
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
所以我在谷歌上搜索了一下,发现了很多关于它的话题。我发现我自己创建的证书必须在 javas cacerts
中。所以我想出了如何添加它:
keytool -import -alias tomcat -file tomcat.crt -keystore {path to cacerts}\cacerts
但是,我收到以下错误消息(德语/英语):
德语:
Keytool-Fehler: java.lang.Exception: Public Keys in Antwort und Keystore stimmen nicht überein
英语(翻译):
Keytool-Error: java.lang.Exception: Public Keys in the answer and keystore does not match
如何使公钥匹配?
最佳答案
keytool -import -alias tomcat -file tomcat.crt -keystore {path to cacerts}\cacerts
您遗漏了 -trustcacerts
参数。
关于ssl - 无法将证书导入 cacerts,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39390956/