0

I am trying to write a program for connecting LDAP server using java code.. Connection Type - SSL

I am getting SSLHandshakeException which says I will have to use 'server certificate' to establish ssl connection - javax.naming.CommunicationException: :636 [Root exception is javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]

Could anyone please suggest how to download SSL certificate from the server using java code and then use that certificate while connecting to LDAP ?

Here are the solutions i have tried, but i did not work - How to read a Certificate attribute (caCertificate) from LDAP server (Java)?

How to make a call, via Java, with ssl and certificate to an ldap (AD)?

NOTE - I cannot override functionality of certificate verification/validation using custom socket factory

  • *Could anyone please suggest how to download SSL certificate from the server using java code and then use that certificate while connecting to LDAP ?* That doesn't really make any security sense, it would leave you vulnerable to a man-in-the-middle attack. – President James K. Polk Jan 06 '23 at 23:27

0 Answers0