LDAPS connection
I have a groovy script to connect to LDAP server; the code is:
import org.apache.directory.groovyldap.LDAP
import org.apache.directory.groovyldap.Search
import org.apache.directory.groovyldap.SearchScope
ldap = LDAP.newInstance('ldap://<Ip address>:389/', 'cn=Manager,dc=telecom,dc=it', 'italtel123')
result = ldap.exists('uid=TstAut01,ou=People,dc=telecom,dc=it')
log.info result
It's possible to use the ldaps protocol instead of ldap (ldaps://<Ip address>:636/) ?
Regards
Massimo
Based on my analysis. this exception would be thrown when your server has self signed certificate and when accessing SSL enabled connections (HTTPS, LDAPS etc.,) . To solve this should add the certificate to the list of trusted certificates (cacerts) of your JVM.
Here is the links for workarounds,
How to fetch certificate - http://magicmonster.com/kb/prg/java/ssl/pkix_path_building_failed.html
How to add the certificate to CACERTS of JVM - http://stackoverflow.com/questions/6908948/java-sun-security-provider-certpath-suncertpathbuilderexception-unable-to-find
Thanks,
Samy
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others, Thanks. ↓↓↓