tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TMo...@s-s-t.com
Subject Re: R: HELP! iSaSiLk 3.04 and Tomcat4
Date Mon, 01 Jul 2002 17:05:45 GMT

Sorry, I'm the one who sent you down this trail, but am at a loss for
ideas..... don't recall having any such problems.

You might scan the reference guide, it's extremely detailed:
http://java.sun.com/j2se/1.4/docs/guide/security/jsse/JSSERefGuide.html

This mentions some of the stuff about setting system properties to make
HttpsURLConnection happy and so on...

There's also a section in there where you can turn on debugging and get
more info from JSSE about what it's doing:
http://java.sun.com/j2se/1.4/docs/guide/security/jsse/JSSERefGuide.html#




                                                                                         
                              
                      "Luca Ventura"                                                     
                              
                      <luca_vent@virgi         To:      "Tomcat Users List" <tomcat-user@jakarta.apache.org>,
          
                      lio.it>                  <TMotte@s-s-t.com>               
                                       
                                               cc:                                       
                              
                      07/01/2002 03:17         Subject: R: HELP! iSaSiLk 3.04 and Tomcat4
                              
                      AM                                                                 
                              
                                                                                         
                              
                                                                                         
                              




Thanks a lot for your reply....

I followed your suggestions and I used JSSE integrated in JDK1.4....anyway
now I have a problem with it....

After installing JDK 1.4 I wrote the following Java code to open HTTPS
connections:


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


             String inputLine;

             while ((inputLine = in.readLine()) != null)
                 System.out.println(inputLine);

             in.close();


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

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

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
"https://jcewww.iaik.at/"
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
1.4??

I hope you or someone else can help me....


Thanks,

            Luca

-----Messaggio originale-----
Da: TMotte@s-s-t.com [mailto:TMotte@s-s-t.com]
Inviato: venerdi 28 giugno 2002 18.19
A: Tomcat Users List
Oggetto: Re: HELP! iSaSiLk 3.04 and Tomcat4



I remember using issasilk a couple years ago... I barely recall there being
some system property that you're supposed to set so that it uses your
particular SSL implementation. I think somehow that's not getting set or
somebody's resetting it after you... hth.

However the thing is, you can get a great SSL implementation straight from
sun nowadays:http://java.sun.com/products/jsse/. The only reason I ever
used issasilk was because my coworkers were adamantly opposed to upgrading
to jdk 1.2 (fud), which was required for Sun's SSL. JSSE was better behaved
(issasilk would always throw an exception at the end of the stream or
something) and of course free. JSSE is now included in JDK 1.4, and is I
think included in some of the tomcat distributions.

But hats off to those Austrian folks for making java SSL inexpensive while
the competition was gouging people for upwards of $20K....

(note - It's probably not necessary to post to both tomcat-dev and users
for this sort of thing)





                      "Luca Ventura"
                      <ventural@libero         To:      "tomcat-user"
<tomcat-user@jakarta.apache.org>
                      .it>                     cc:
                                               Subject: HELP! iSaSiLk 3.04
and Tomcat4
                      06/28/2002 03:35
                      AM
                      Please respond
                      to "Tomcat Users
                      List"







Hello everybody!

I have the following problem....

I have installed Apache Tomcat 4 (as Web Server) on a Windows XP machine.
Then I have
written a servlet that use IAIK's iSaSiLk 3.04 APIs to open https
connections
(you can find iSaSiLk at:
http://jcewww.iaik.tu-graz.ac.at/products/index.php).

The problem is that when my servlet tries to connect to a secure site (like
"https://jcewww.iaik.at/")
I receive a strange error:

java.lang.ClassCastException:
sun.net.www.protocol.https.HttpsURLConnectionImpl

In attach you find a snapshot with the detailed descriprion of the error
(note that
https.Https is the class I have written to open https connections).

The code that I have written (in the https.Https class used by the servlet)
to open https connections is:

import java.io.*;
import java.net.*;
import iaik.security.ssl.*;
import iaik.protocol.https.*;

.
      String urlString = "https://jcewww.iaik.at/";
      URL url = new URL(urlString);
      HttpsURLConnection con = (HttpsURLConnection)url.openConnection();
      SSLContext context = new SSLClientContext();
             con.setSSLContext(context);
      con.setRequestMethod("POST");
      con.setDoInput(inviaInput);
      con.setDoOutput(true);

I receive the "java.lang.ClassCastException" at the moment to execute the
statement:
HttpsURLConnection con = (HttpsURLConnection)url.openConnection();


I want to point out that I have put
"iaik_jce_full.jar","iaik_ssl.jar","w3c_http.jar" in the WEB-INF/lib folder
of my application.

The strange thing is that if I tried to execute my https connection using
the same IAIK's libraries
but from a Java stand-alone program (that is to say without using the Web
Server and the servlet)
all works fine. I am afraid that there is some library installed in my Web
Server that has some conflict with iSaSiLk 3.04 APIs.

What do you think about?

Is there someone can help me?

Thanks a lot in advance.

                                  Luca
(See attached file: errorTomcat.jpg)--
To unsubscribe, e-mail:   <
mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:tomcat-user-help@jakarta.apache.org>







--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message