[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-ssl]cu|| Help! javax.net.ssl.SSLHandshakeException in JDK1.4!!!

Hello everybody!

I have installed JDK 1.4 and wrote the following Java code to open HTTPS

      URL verisign = new URL("https://jcewww.iaik.at/";);
      HttpsURLConnection con =
      InputStream ins = con.getInputStream();
      InputStreamReader isr=new InputStreamReader(ins);
      BufferedReader in =new BufferedReader(isr);

	String inputLine;

	while ((inputLine = in.readLine()) != null)


At statement  "InputStream ins = con.getInputStream();" I receive this

javax.net.ssl.SSLHandshakeException: Could not find trusted certificate

In attach you find the snapshot with the detailed description of the error.

If as URL I insert www.verisign.com all works correctly. I tried to set a my
HostNameVerifier class for the HttpsURLConnection object. It is something
like this:

class MyVerif implements HostnameVerifier
        public boolean verify(String hostname, SSLSession session)
           return true;

The verify process returns always "true" in any case....I thought that this
trick let me
to avoid this type of error but I was wrong, in fact inserting the URL
I receive the same error :-(

I tried to install IAIK provider and iSaSiLK APIs and all works fine with
url "https://jcewww.iaik.at/";
too!! How come? It seems that IAIK provider doesn't check if there is a
trusted certificate available....

How can I avoid the "javax.net.ssl.SSLHandshakeException" using only JDK

Thanks a lot everybody in advance!


Attachment: error.jpg
Description: JPEG image