Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Security > request server ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1726 of 1791
Post > Topic >>

request server certs from an LDAPS connection

by Dave <david.stutzman@[EMAIL PROTECTED] > Oct 3, 2007 at 09:14 AM

I'd like to get the server certificate(s) of the LDAPS server I am
connecting to so I can send an OCSP request off to validate the
certificate(s). This is very easy with https as HttpsUrlConnection has
a method to get the certs (getServerCertificates() ). Is there
anything similar for getting the certs of the LDAPS connection?

The client-authenticated LDAPS connection is set up by setting a bunch
of system and context variables.

System.setProperty("javax.net.ssl.keyStoreType", "PKCS12"); (or PKCS11
for hardware)
System.setProperty("javax.net.ssl.keyStore", <insert path here>);
(NONE for PKCS11 keystoretype)
System.setProperty("javax.net.ssl.trustStore", <insert path here>);
System.setProperty("javax.net.ssl.keyStorePassword", <insert password
here>);
System.setProperty("java.naming.factory.initial",
"com.sun.jndi.ldap.LdapCtxFactory");

Hashtable<String, String> env = new Hashtable<String, String> ();
env.put(Context.PROVIDER_URL, <insert ldap server url>);
env.put(Context.SECURITY_PROTOCOL, "ssl");
env.put("java.naming.ldap.version", "3");

DirContext ctx = new InitialDirContext(env);

I then use the context to talk to the server.

I don't see a way to get the server's credentials (certificate) from
the context through the java API.  If anyone has any ideas on this I'd
appreciate the help.

Thanks,
Dave
 




 1 Posts in Topic:
request server certs from an LDAPS connection
Dave <david.stutzman@[  2007-10-03 09:14:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 10:10:32 CDT 2008.