Skip to content
Advertisement

how to accept self-signed certificates for JNDI/LDAP connections?

I need to connect to an LDAP directory over SSL.

In non-production environments, we use self-signed certificates which, of course, fails to validate with:

JavaScript

I am aware of how to use a custom trust manager for SSL-enabled connections, but don’t know how to use one in connection with the JNDI API where I don’t manage the actual connection. That is, where is the following standard setup will I be able to plug the trust manager?

Thanks in advance.

JavaScript

Advertisement

Answer

According to the JNDI documentation it seems possible to set a custom SSLSocketFactory

http://download.oracle.com/javase/1.5.0/docs/guide/jndi/jndi-ldap-gl.html#socket

JavaScript

Configure the environment to use this socket factory

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement