java - Spring LDAP TLS/SSL 异常 : PKIX path building failed: unable to find valid certification path to requested target

标签 java spring ssl ssl-certificate spring-ldap

通过 TLS 连接到 LDAP 服务器失败并出现异常

org.springframework.ldap.UncategorizedLdapException: Failed to negotiate TLS session; nested exception is 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
at org.springframework.ldap.core.support.AbstractTlsDirContextAuthenticationStrategy.processContextAfterCreation(AbstractTlsDirContextAuthenticationStrategy.java:155)
at org.springframework.ldap.core.support.AbstractContextSource.getContext(AbstractContextSource.java:109)
at org.springframework.ldap.core.support.AbstractContextSource.getReadOnlyContext(AbstractContextSource.java:125)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:287)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:259)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:571)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:556)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:411)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:431)

我已经检查了我的 keystore 中是否存在适当的证书并导入了缺失的证书,如 PKIX path building failed while making SSL connection 中所述但是我仍然遇到异常(exception)。有什么想法吗?

谢谢,

奈杰尔

最佳答案

问题出在 LDAP 服务器生成的证书上,这已经得到验证,现在问题已解决。

关于java - Spring LDAP TLS/SSL 异常 : PKIX path building failed: unable to find valid certification path to requested target,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7443560/

相关文章:

java.awt.image。是谷歌应用程序引擎中的受限类

java - 我们可以解密使用不同算法加密的密文吗?

java - 我可以将 Spring Social 与 Spring Security 一起使用吗?

java - 双重嵌套事务的回滚绕过保存点

python - _ssl.sslwrap 函数参数的类型强制

java - Java 中大型 BigInteger 的更快质因数分解

java - 登录多线程应用程序

java - 无法使用 JPA 实例化集合持久化器

node.js - NodeJS OpenShift App 在 https 上超时,但在 http 上不超时

apache - 强制 HTTP 重定向到 HTTPS 会忽略子域