Spring LDAP TLS / SSL Exception: PKIX path building failed: unable to find valid certification path to requested target

StackOverflow https://stackoverflow.com/questions/7443560

Pregunta

Connecting to the LDAP server over TLS fails with the exception

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)

I have checked the appropriate certificates are present in my key store and imported missing ones as described in PKIX path building failed while making SSL connection however I am still getting the exception. Any ideas?

Thanks,

Nigel

¿Fue útil?

Solución

The problem is with the certificates produced by LDAP servers, this has been verified and issue now resolved.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top