Skip to main content

developerWorks >  Java technology  >  Forums  >  Java security  >  developerWorks

SSL communication with Directory Server    Point your RSS reader here for a feed of the latest messages in this thread


Tags for this thread: 

     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
Permlink Replies: 2 - Pages: 1 - Last Post: Nov 1, 2009 10:15 AM Last Post By: mailman_2097
mailman_2097

Posts: 18
Registered: Jun 16, 2009 11:15:56 AM
SSL communication with Directory Server
Posted: Oct 29, 2009 01:25:39 PM
Click to report abuse...   Click to reply to this thread Reply
I am getting exception when I try to execute Java Code to connect to Tivoli Directory Server using SSL.
Earlier I was using the default port 389, now i want to try connecting using SSL.

Exception Sample->

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

How it all started -->

I followed a tutorial to configure SSL on my TDS instance:

Step 1: Enabled SSL on my LDAP Server
a. Create self signed certificate
b. extracted cert as .arm it using gsk7ikm

Step 2: Tried to verify the server CMS
a. Create CMS on client
b. Get extracted Self Signed Certificate from server kdb
c. Add certificate to Client CMS

Then I realised that I had can save the Client KDB file as JKS and extract the certificate from it and import it into the java keystore.

So I took the JKS and extracted mycert.crt file

:>keytool -exportcert -alias sslldap -keystore client_java_key.jks -storepass p@ssw0rd -file mycert.crt

I then imported the extracted mycert.crt file using
:>keytool -importcert -alias sslldap -file mycert.crt

Also, SSL is working and I can telnet to host with ssl port 636.
----

I am not sure as what I am doing wrong here. Some help would be greatly appreciated.

----
Here is the dump of the stack trace:

javax.naming.CommunicationException: simple bind failed: vmldap:636 [Root e
xception is javax.net.ssl.SSLHandshakeException: sun.security.validator.Validato
rException: PKIX path building failed: sun.security.provider.certpath.SunCertPat
hBuilderException: unable to find valid certification path to requested target]
at com.sun.jndi.ldap.LdapClient.authenticate(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.<init>(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at javax.naming.directory.InitialDirContext.<init>(Unknown Source)
at com.ldap.LDAPTest.test2(LDAPTest.java:98)
at com.ldap.LDAPTest.main(LDAPTest.java:85)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.Validator
Exception: PKIX path building failed: sun.security.provider.certpath.SunCertPath
BuilderException: unable to find valid certification path to requested target
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unkno
wn Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source
)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Un
known Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Sou
rce)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at com.sun.jndi.ldap.Connection.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find vali
d certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(Unknown So
urce)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
Unknown Source)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
Unknown Source)
... 13 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown
Source)
at java.security.cert.CertPathBuilder.build(Unknown Source)
... 19 more
mailman_2097

Posts: 18
Registered: Jun 16, 2009 11:15:56 AM
Re: SSL communication with Directory Server
Posted: Nov 01, 2009 10:09:53 AM   in response to: mailman_2097 in response to: mailman_2097's post
Click to report abuse...   Click to reply to this thread Reply
issue closed...
mailman_2097

Posts: 18
Registered: Jun 16, 2009 11:15:56 AM
Re: SSL communication with Directory Server
Posted: Nov 01, 2009 10:15:46 AM   in response to: mailman_2097 in response to: mailman_2097's post
Click to report abuse...   Click to reply to this thread Reply
btw...i have a duplicate post...solution was identified in previous thread.
 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums