TLS not working with Openssl Certs

Hi I have been struggleing with a certificate problem for about two weeks now with no joy. Almost all the forums, tutorials and examples etc. I have tried are simply not working. Without fail I get the following exception or similar:

[Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found]

Basically I know I have a valid certificate, because when I use an ldap client with just the self generated cacert.pem there are no problems and a TCP dump shows the encrypted data.

My setup is as follows I have an openLDAP server running on Debian. I generated my own certificates as per: http://www.openldap.org/faq/data/cache/185.html

All I want to do now is import these generated certs/keys with keytool, and be able to use theme with TLS.

When importing the certs via java ldap browsers they work fine, but as soon as I try use my own TLS client like the StartTLS.java sample provided by the java tutorial I get the above exception. I'm probably missing some piece of the puzzle.

Please if anyone else knows how to set this up correctly using the certs I have generated via the openldap example above I would really appreciate your help. There are alot of examples pertaining to app servers etc. but nothing I could find to talk to OpenLDAP.

regards

ed

[1380 byte] By [edejongha] at [2007-10-1 19:17:56]
# 1
apologies, I am using j2sdk1.4.2 and OpenLdap 2.2.x (V3)thanksed
edejongha at 2007-7-11 15:21:09 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2

On a similar occation i did extend the javax.net.ssl.X509TrustManager

and upon generating the connecton I first did initialized the ssl context with that trust manager.

something like

SSLContext sslContext = SSLContext.getInstance("SSLv3");

...

MyTrustManager tm = new MyTrustManager(....);

TrustManager tms[] = {tm};

sslContext.init(null, tms, null);HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory()); //or on ur corresponding tls connection class

do that before getting any https connection or alike tls connections

In case that does not bring you further, post some stack trace and further settings.

babakNa at 2007-7-11 15:21:09 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...