LDAP SSL Connection Error --javax.net.ssl.SSLHandshakeException: sun.secur

Hello

I am trying to connect to the LDAP server through SSL i have the certificate sent by the Ldap Admin i get the following exception.

Any thoughts will b helpful

***

Thread-0, SEND TLSv1 ALERT: fatal, description = certificate_unknown

Thread-0, WRITE: TLSv1 Alert, length = 2

Thread-0, called closeSocket()

Thread-0, handling exception: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

main, handling exception: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

Exception: javax.naming.CommunicationException: simple bind failed: AG0319006WD202.net.ads.state.tn.us:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found]

Message: simple bind failed: AG0319006WD202.net.ads.state.tn.us:636

Explanation: simple bind failed: AG0319006WD202.net.ads.state.tn.us:636

Root cause:

sun.security.validator.ValidatorException: No trusted certificate found

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

XXX FAILED XXX

Authentication attempt failed - Connect failed: simple bind failed: AG0319006WD202.net.ads.state.tn.us:636

[1378 byte] By [Surendra_Varmaa] at [2007-11-27 7:43:48]
# 1
> i have the certificate sent by the Ldap AdminThat's nice, you have it, but do you have it in your truststore? and have you told Java where the truststore is?
ejpa at 2007-7-12 19:24:32 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2

hello

Thanks fo your reponse

infact i did and this is how it looks like

Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

//the truststore that holds trusted root certificates

System.setProperty("javax.net.ssl.trustStore", "C:\\trust");

System.setProperty("javax.net.debug", "all");

//Build the LDAP url

String ldapurl = "ldap://" + ConnParams.dirHostName + ":" + ConnParams.dirPort;

_directoryEnv = new Hashtable();

_directoryEnv.put(Context.INITIAL_CONTEXT_FACTORY,INITCTX);

_directoryEnv.put(Context.PROVIDER_URL, ldapurl);

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

_directoryEnv.put("com.sun.jndi.ldap.trace.ber", System.err);

// Enable connection pooling

_directoryEnv.put(CONNECTION_POOL, "true");

// set the credentials

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

//_directoryEnv.put(Context.SECURITY_AUTHENTICATION, "EXTERNAL");

// set the ldap version

_directoryEnv.put(LDAP_VERSION, "3");

_directoryEnv.put(Context.SECURITY_PRINCIPAL, ConnParams.appUser);

_directoryEnv.put(Context.SECURITY_CREDENTIALS, ConnParams.appUserPassword);

Please let me know if i am missing something

Thanks

Surendra

Surendra_Varmaa at 2007-7-12 19:24:32 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 3
Well the exception doesn't exactly agree with you. I would review all those steps.Also get rid of this:Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());which isn't required post JDK 1.3.
ejpa at 2007-7-12 19:24:33 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...