title: Spring LDAP TLS / SSL Exception: PKIX path building failed: unable to find valid certification path to requested target
body: <p>Connecting to the LDAP server over TLS fails with the exception</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>I have checked the appropriate certificates are present in my key store and imported missing ones as described in <a href="https://stackoverflow.com/questions/2290570/pkix-path-building-failed-while-making-ssl-connection">PKIX path building failed while making SSL connection</a> however I am still getting the exception. Any ideas?</p>
  
  <p>Thanks,</p>
  
  <p>Nigel</p>