【问题标题】:Tomcat SSL: unable to find valid certification path to requested targetTomcat SSL:无法找到请求目标的有效证书路径
【发布时间】:2014-05-26 03:32:55
【问题描述】:

我正在尝试访问我的应用程序中的一个 url,但我收到了这个错误。

1771426 [http-bio-8180-exec-15] ERROR gadget.GadgetValidatorServlet  - wsdl.exception.WSInvokerException: wsdl.exception.WSInvokerException: javax.xml.ws.soap.SOAPFaultException: 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
1771426 [http-bio-8180-exec-15] ERROR gadget.GadgetPortalValidatorServlet  - gadget.exception.GadgetValidatorException: wsdl.exception.WSInvokerException: wsdl.exception.WSInvokerException: javax.xml.ws.soap.SOAPFaultException: 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

我已尝试应用所有这些修复,但没有成功: http://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/

很快它需要运行 InstallCert 应用程序 (java InstallCert my.domain.com) 并生成文件 jssecacerts。之后,我将此文件复制并粘贴到 /opt/java/jdk1.7.0_45/jre/lib/security/jssecacerts

我还将我的证书(与我的 ssl url (httpd) 中使用的证书相同)导入到我的 tomcat 使用的密钥库中。

即使在那之后我仍然收到此错误。

有什么想法吗?

【问题讨论】:

  • 你应该已经将它导入到Tomcat使用的truststore中。
  • 我已经将它导入到我的密钥库中,我在 tomcat 连接配置中导入了它。

标签: java tomcat ssl ssl-certificate pki


【解决方案1】:

过去我可以通过在运行时将javax.net.ssl.trustStore 系统属性设置为指向jssecacerts 文件来解决此问题。只是把它放在“正确”的地方对我来说从来没有用过;我必须明确设置位置。无论如何,这更便携,所以如果您的应用需要移动,我一般建议使用它。

System.setProperty("javax.net.ssl.trustStore", "/path/to/jssecacerts");

【讨论】:

    猜你喜欢
    • 2017-09-19
    • 1970-01-01
    • 2013-05-24
    • 1970-01-01
    • 2020-03-01
    • 1970-01-01
    • 2020-11-11
    • 2011-10-18
    • 2020-09-14
    相关资源
    最近更新 更多