"PKIX path building failed" 在单独的 Tomcat 实例上分布式 CAS 应用程序时出现异常

"PKIX path building failed" exception when distributed CAS applications on separate Tomcat instance

最近,我开始着手配置 Spring Web 应用程序以与 Jasig CAS 一起使用。当我在已经配置为使用 SSL 的 Eclipse(Spring 工具套件)中创建的服务器中 运行 CAS 客户端和 CAS 服务器时,一切正常。我能够 运行、身份验证、注销...但是,当我创建一个 Tomcat 与 STS 中的服务器具有相同 server.xml 的实例并让应用程序 运行 在其上,在向 CAS 服务器登录表单输入用户名、密码并且服务器使用生成的票证重定向到客户端登录页面后发生此异常:

HTTP Status 500 - 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

我使用了与 STS Tomcat 服务器中相同的密钥库和信任库文件,并且证书已导入文件 jre/lib/security/cacerts。

当我尝试 运行 Eclipse Tomcat 服务器中的 CAS 客户端与独立 Tomcat 服务器中的 CAS 服务器时,没问题。但反之亦然。

STS Tomcat实例和独立Tomcat实例有什么区别吗?两者指的是相同的 CATALINA_BASE.

我使用 Tomcat 7.0.67,CAS 3.6.0,Spring 安全 3.1.4。

找到原因了。我同时安装了 JRE 和 JDK。 Tomcat 在 Eclipse 中使用 JRE,但独立 Tomcat 在 JDK 中使用 JRE。我将证书导入此 JRE 并且它有效。感谢 paulsm4 的建议。