2014-04-11 74 views
4

我试图访问我的应用程序中的网址,但我收到此错误。Tomcat SSL:无法找到要求的目标的有效证书路径

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使用的keystore中。

即使在那之后,我仍然得到这个错误。

有什么想法?

+0

您应该将它导入到Tomcat使用的* truststore *中。 – EJP

+0

我将它导入到我的密钥库中,该密钥库是我在tomcat连接配置中导入的。 – Santiago

回答

2

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

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

它没有工作:( – Santiago

相关问题