I wanted the SSL Certificate of my LDAP Server which is Novell eDirectory. I have used openssl to connect to ldap to view the certificate.
openssl s_client
There is a tool that lets you collect and save an SSL/TLS certificate from a server that speaks not only LDAPS, but LDAP/STARTTLS too. That's a revision of the well-known InstallCert program, written in Java.
Just run it like this:
java -jar installcert-usn-20131123.jar host_name:port
and it will save the certificate for you in the jssecacerts
keystore file in your JRE file tree, and also in the extracerts
keystore file in your current directory. You can then use Java keytool to export the certificate(s) to other formats.
You are welcome to visit my blog page Yet another InstallCert for Java, now with STARTTLS support for download and instructions.