How do I get the SSL certificate for an LDAP server using StartTLS?

Eric

I am trying to configure my application to access an LDAP server that is listening only on port 389 using the StartTLS extension for security. I want to get a copy of the SSL certificate so I can specify it as a known certificate (in a jssecacerts file, since my application is written in Java).

If it was running on port 636, I would use openssl like so:

openssl s_client -host myhost -port 636

and grab the certificate from the output.

My first though was to try using:

openssl s_client -host myhost -port 389 -starttls ...

but that doesn't support the LDAP version of starttls.

Then, I tried using ldapsearch with a high debug level:

ldapsearch -ZZ -h myhost -d99 ...

and I could see that the over-the-wire data includes the certificate, but it's not in a form that I know how to use.

Is there an easy way to get the certificate, either through command line tools or a short program? (I don't particularly care which language, but Java would be ideal)

Sergey Ushakov

A new revision of the well-known InstallCert program now supports STARTTLS for several protocols, LDAP included.

Just run it like this:

java -jar installcert-usn-20131123.jar host_name:389

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I force Python LDAP to validate/verify an SSL certificate when using .start_tls_s()

From Dev

How to validate server SSL certificate for LDAP+SSL connection

From Dev

How to use UnboundID SDK to connect to an LDAP server with the SSL server certificate?

From Dev

If I'm using a reverse proxy on Nginx do I need an SSL certificate for the reverse proxy and the server?

From Dev

How do i get the url of certificate generated using prawn?

From Dev

How do I allow a user to trust and pin a self-signed SSL Certificate using AFNetworking in iOS

From Dev

Using powershell, how do I extract the thumbprint from an SSL Certificate without installing it?

From Dev

How do I get certificate information from p12 certificate using javascripts forge?

From Dev

LDAP store SSL certificate

From Dev

How do I restore a missing IIS Express SSL Certificate?

From Dev

How do I use an SSL client certificate with Apache HttpClient?

From Dev

How do I install a system-wide SSL certificate on openSUSE?

From Dev

How do I silently request a specific SSL client certificate

From Dev

How do I create a self-signed SSL certificate?

From Dev

How do I create a self-signed SSL certificate?

From Dev

How do I install a system-wide SSL certificate on openSUSE?

From Dev

How to resolve error to get SSL certificate using Letsencrypt certbot?

From Dev

How to get trusted SSL certificate?

From Dev

How can I pass a SSL certificate to Nowin when using Nancy

From Dev

How can I secure all web server in a multi domain (Active Directory Forest) environment using single SSL certificate?

From Dev

How do I accept a self-signed SSL certificate using iOS 7's NSURLSession and its family of delegate methods for development purposes?

From Dev

How do I address "SSL certificate problem: certificate has expired" on syncronization with pacman?

From Dev

How do I get the public key from a PFX certificate using Powershell?

From Dev

How can I implement server side SMTP STARTTLS?

From Dev

How can I implement server side SMTP STARTTLS?

From Dev

How do you connect to an LDAP server using node-oracledb?

From Dev

PHPMailer - SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

From Dev

Do I need a SSL Certificate for an Intranet application

From Dev

Do I need a SSL Certificate for an Intranet application

Related Related

  1. 1

    How do I force Python LDAP to validate/verify an SSL certificate when using .start_tls_s()

  2. 2

    How to validate server SSL certificate for LDAP+SSL connection

  3. 3

    How to use UnboundID SDK to connect to an LDAP server with the SSL server certificate?

  4. 4

    If I'm using a reverse proxy on Nginx do I need an SSL certificate for the reverse proxy and the server?

  5. 5

    How do i get the url of certificate generated using prawn?

  6. 6

    How do I allow a user to trust and pin a self-signed SSL Certificate using AFNetworking in iOS

  7. 7

    Using powershell, how do I extract the thumbprint from an SSL Certificate without installing it?

  8. 8

    How do I get certificate information from p12 certificate using javascripts forge?

  9. 9

    LDAP store SSL certificate

  10. 10

    How do I restore a missing IIS Express SSL Certificate?

  11. 11

    How do I use an SSL client certificate with Apache HttpClient?

  12. 12

    How do I install a system-wide SSL certificate on openSUSE?

  13. 13

    How do I silently request a specific SSL client certificate

  14. 14

    How do I create a self-signed SSL certificate?

  15. 15

    How do I create a self-signed SSL certificate?

  16. 16

    How do I install a system-wide SSL certificate on openSUSE?

  17. 17

    How to resolve error to get SSL certificate using Letsencrypt certbot?

  18. 18

    How to get trusted SSL certificate?

  19. 19

    How can I pass a SSL certificate to Nowin when using Nancy

  20. 20

    How can I secure all web server in a multi domain (Active Directory Forest) environment using single SSL certificate?

  21. 21

    How do I accept a self-signed SSL certificate using iOS 7's NSURLSession and its family of delegate methods for development purposes?

  22. 22

    How do I address "SSL certificate problem: certificate has expired" on syncronization with pacman?

  23. 23

    How do I get the public key from a PFX certificate using Powershell?

  24. 24

    How can I implement server side SMTP STARTTLS?

  25. 25

    How can I implement server side SMTP STARTTLS?

  26. 26

    How do you connect to an LDAP server using node-oracledb?

  27. 27

    PHPMailer - SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

  28. 28

    Do I need a SSL Certificate for an Intranet application

  29. 29

    Do I need a SSL Certificate for an Intranet application

HotTag

Archive