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:
javac InstallCert.java/lib/security/ directory of your JRE, and is called cacerts. You might want to make a backup before messing with it.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.