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

RE: [iaik-ssl]cu|| [iaik-jce] HELP! iSaSiLk 3.04 and Tomcat4



Hi !

You have to tell your application which URLStreamHandler to use
Tomcat uses it's own URLStreamHandler. 


see 
http://java.sun.com/j2se/1.3/docs/api/java/net/URL.html#URL(java.net.URL,%20
java.lang.String,%20java.net.URLStreamHandler)

public URL(URL context,
           String spec,
           URLStreamHandler handler)

That would look something like: 

If you are using JDK 1.2 you can specify the handler dynamically when
creating an URL object. 
  URL u = new URL(null, "https://...";, new iaik.protocol.https.Handler());




Mit freundlichen Grüßen

Andreas Hiltenkamp


PS: Please stop posting your requests more than once. If you've questions
about SSL
post it to iaik-ssl and not to iaik-ssl and iaik-jce as well.

  _____  


Healy Hudson AG
impact gateway Development Team
Zweigstraße 10
D-80336 München
Germany

mailto:Andreas.Hiltenkamp@healy-hudson.com 
Tel.:  +49 89 / 511 14    - 278
Fax.:  +49 89 / 548 84 88 - 278
http://www.healy-hudson.com


> -----Original Message-----
> From: Luca Ventura [mailto:luca_vent@virgilio.it]
> Sent: Freitag, 28. Juni 2002 10:31
> To: iaik-ssl; iaik-jce
> Subject: [iaik-jce] HELP! iSaSiLk 3.04 and Tomcat4
> 
> 
> 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. 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
> 
--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-ssl/sslthreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content: UNSUBSCRIBE iaik-ssl