views:

731

answers:

2

In Websphere when you do an LDAP query using LdapContext are the transmission of credentials encrypted?

LdapContext ctx = new InitialLdapContext (env, null);

Lets say I make an LdapContext for a web app to do some custom LDAP calls.

How do I know if my call is secure / encrypted?

+3  A: 

In order to secure/encrypt your LDAP calls you need to issue the "Start TLS" operation.

Otherwise I think transport is plain text.

For more:

http://java.sun.com/products/jndi/tutorial/ldap/ext/starttls.html

Obviously the Java API is based on LDAP itself. So you could learn more about how the protocol itself handles it...i.e.:

http://en.wikipedia.org/wiki/Ldap#StartTLS

Michael Sharek
A: 

Use ethereal or wireshark and snoop your LDAP connection to check if it is encrypted. If its encrypted then great, if not then try Michael Sharek's suggestion.

If you find there is absolutely no way to setup encryption with code, then you can use stunnel. With stunnel you would make a unsecured connection to a port on the localhost, stunnel is listening on that port, encrypts everything with SSL and then sends the info to the LDAP server. Is very useful when using 3rd party apps that have no notion of network security.

Patrick