I enabled SSL in SUN ONE Directory Server 5.2, I use the following code to download the server certs,
Hashtable env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldaps://bharatkumar.webm.webmethods.com:636/o=in");
env.put(Context.SECURITY_AUTHENTICATION, "EXTERNAL");
env.put(Context.SECURITY_PROTOCOL, "ssl");
try {
// Create initial context
DirContext ctx = new InitialDirContext(env);
System.out.println(ctx.lookup("ou=web"));
ctx.close();
} catch (NamingException e) {
e.printStackTrace();
}
But it throws the following error:
javax.naming.CommunicationException: SASL bind failed: bharat.com:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.
validator.ValidatorException: PKIX path building failed: sun.security.provider.c
ertpath.SunCertPathBuilderException: unable to find valid certification path to
requested target]
at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:220)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2637)
at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:283)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193
How to rectify the above error?
Kindly Help me.
Thanks,
Bharat
server certs installed in sun one directory server is not trusted.
Verisign - Trail SSL Certificate is installed into server certs. But it is not trusted. How can I explicitly trusted that certificate. (OR) where can i get the trusted certificate and installed into server cert.
Kindly Help me,
Thanks,
Bharat