cancel
Showing results for 
Search instead for 
Did you mean: 

Connect to LDAP

Former Member
0 Kudos

Hi,

While i am trying to connect to LDAP , i am getting an exception

javax.naming.CommunicationException: simple bind failed: wdsapusny001001.sapad.internal.symbol.com:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate

found]

The code i used is

Hashtable env = new Hashtable();

String ADuid = "A94444";

String ADpwd = "asdasdasd";

env.put(Context.INITIAL_CONTEXT_FACTORY,

"com.sun.jndi.ldap.LdapCtxFactory");

env.put(Context.SECURITY_AUTHENTICATION,"simple");

env.put(Context.SECURITY_PRINCIPAL,ADuid);

env.put(Context.SECURITY_CREDENTIALS,ADpwd);

env.put(Context.SECURITY_PROTOCOL,"ssl");

env.put(Context.PROVIDER_URL, "ldaps://wdsapusny001001.sapad.internal.com:636");

try {

DirContext ctx = new InitialDirContext(env);

}catch(Exception ex){

wdComponentAPI.getComponent().getMessageManager().reportException( ex.toString(),false);

}

please give me some suggestions

AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Anoop,

You are trying to connect to a secure LDAP server and thats why it expects a server certificate.

Follow this link.

http://java.sun.com/products/jndi/tutorial/ldap/security/ssl.html

Hope that's helpful.

Regards,

Rajit

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Anoop,

Have you uploaded the LDAP servers certificate in the TrustedCAS of the keystore in Visual Admin in the WAS server? If you are using LDAP ssl the connection to the server will expect a certificate if you dont have the trust enabled you wont be able to connect.

Regards

Prakash

Former Member
0 Kudos

hi

good

go through this link

http://help.sap.com/saphelp_nw04s/helpdata/en/48/d1d13f7fb44c21e10000000a1550b0/content.htm

thanks

mrutyun^

Message was edited by:

Armin Reichert