Using SSL with LDAP

If you intend to use SSL with LDAP, and your LDAP server uses a self-signed key, you will need to add its certificate to your Java keystore before authentication will work. follow these instructions:

  1. Download the program found here. Compile it with javac InstallCert.java
  2. Your Java keystore is usually found in the /lib/security/ directory of your JRE, and is called cacerts. You might want to make a backup before messing with it.
  3. Run the command java InstallCert [server name]:[LDAP SSL port] [keystore location]. Alternatively, if you omit the keystore location parameter, it will create a file in the current directory called jssecacerts. You might prefer to do this, and then manually move/rename the file produced into the correct location.