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

标签 java tomcat ssl ssl-certificate pki

我正在尝试访问我的应用程序中的 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 使用的 keystore 中。

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

有什么想法吗?

最佳答案

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

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

关于java - Tomcat SSL : unable to find valid certification path to requested target,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23021719/

相关文章:

java - 无法从 Tomcat 连接到 HBase

java - 连接到 https 站点时发生 SSLHandshakeException

ssl - 如何为 Valhalla map 服务器配置 SSL/HTTPS?

java - Dr.Java 与 ASCII 显示相关

java - ListView 致命异常 : main java. lang.NullPointerException

tomcat - 在服务器上的特定目录中上传文件

string - 在 Perl 中存储对字符串的套接字响应

java - Swing 中的同步

java - 字符串中的唯一字符

eclipse - IllegalArgumentException:名为 [program] 和 [com.test.Servlet] 的 servlet 都映射到不允许的 url-pattern [/Servlet]