We help IT Professionals succeed at work.

JSSE

QNA
QNA asked
on
Medium Priority
239 Views
Last Modified: 2011-10-03
I'm using java secure socket extension library or class to write a SSL client. The server requires client authentication (certificate from client). I can establish the connection but I got an error : IOException : No trusted certificat found". I have got my certificate installed on my machine and it's a valid cert.

the code looks like this :

               System.out.println("Attempt to connect to 202.187.211.6..\n");

               SSLSocket s = (SSLSocket)SSLSocketFactory.getDefault().createSocket("202.187.211.6", 11030);

               System.out.println("Connected to 202.187.211.6\n");

               s.addHandshakeCompletedListener(new HandshakeCompletedListener()
               {
                    public void handshakeCompleted(HandshakeCompletedEvent hce)
                    {
                         System.out.println("Handshaking process done.\n");
                         System.out.println("Handshake:");
                         System.out.println("  " + hce.getCipherSuite());                          
                    }
               });

               System.out.println("Start handshaking process..\n");

               s.startHandshake();

How do I send the certificate to the server ?
Comment
Watch Question

You have to install your certificate in the java keystore using the keytool programm. You do not need you certificate to the server, jsse do this for you.

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points for Oliver_Dornauf

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venabili
EE Cleanup Volunteer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.