JavaLdapCerts

Note: You are viewing an old revision of this page. View the current version.

Java, LDAP, and Chained Self-Signed Certificates

I had a java / tomcat app (Artifactory) that was configured to use LDAP for user authentication, and I was asked to make it use LDAP over SSL with a self-signed certificate. That turned out to be not very well documented, so here are my notes on how to do it.

First of all, you need to understand how java applications use security certificates. There's a certificate store file (typically called cacerts that contains all the public ssl trusted root keys. That file is loaded by the java interpreter when it starts up and serves as the source of truth for which certificates to trust. If your application uses an 'officially' signed certificate, everything will automatically work.

However, you may need to use a self-signed certificate. In this case, java doesn't know about the authenticity of your certificate because it isn't a descendent of one of the official root certificates. Thus you need to manually add your server public key to a new cacerts file and tell java to use that file instead of the default one.



Our Founder
ToolboxClick to hide/show