Tomcat SSL: unable to find valid certification path to requested target

江枫思渺然 提交于 2019-12-04 03:43:59

问题


I'm trying to access an url in my application, but I'm getting this error.

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

I've tried to apply all of those fixes but with no success: http://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/

Shortly it needs to run InstallCert app (java InstallCert my.domain.com) and generate the file jssecacerts. After that I've copied and paste this file into /opt/java/jdk1.7.0_45/jre/lib/security/jssecacerts

I've also import my cert, the same used in my ssl url (httpd) into my keystore used by tomcat.

Even after that I still getting this error.

Any thoughts?


回答1:


I've been able to fix this problem in the past by setting the javax.net.ssl.trustStore system property at runtime to point to the jssecacerts file. Just putting it in the "right" place never worked for me; I had to set the location explicitly. This is more portable anyway, so I recommend it in general if your app ever needs to move around.

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


来源:https://stackoverflow.com/questions/23021719/tomcat-ssl-unable-to-find-valid-certification-path-to-requested-target

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!