2014-04-11 72 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

相關問題