Re: Answer to the question: Howto use KSoap with SSL in J2SE the easy way.

StonedMonk <[email protected]> Tue, 20 Apr 2004 07:43:27 -0700 (PDT)
Newsgroups gmane.comp.java.enhydra.ksoap
Message-ID <[email protected]>
Hey Davide ::

You are right on. (I posted something similar when you
and I talked about this topic about 2 months ago) -
http://ksoap.enhydra.org/project/mailingLists/ksoap/msg00903.html

I did end up creating an HttpsTransportSE - but only
to  extend the "call" method for HTTPS and to not
disrupt the original HttpTransportSE. =20

Quote from eariler post: "All J2ME/CDC applications
have access to HTTPS functions, but HTTPS support is
not officially required in the MIDP 1.0 specification.
Given the obvious importance of HTTPS in mobile
commerce, many MIDP device vendors have added support
for HTTPS to their own MIDP runtime implementations
anyway. Sun Microsystems also added HTTPS support to
its J2ME Wireless Toolkit from version 1.0.2 forward.
MIDP 2.0 spec has SSL as a requirement.."

This does work! :-) I was able to get kSOAP and Tomcat
4 to talk SSL - I used java's keytool to create local
certs and if you're using Sun's emulator, all you need
to do is make your cert "known".=20

I also got Basic Authentication to work :-))

Thanks for the extra links!

Mike

--- Davide Inglima <[email protected]>
wrote:
> I found it this morning, so I will share this with
> the mailing list :)
> I reckon with an aftertought that everything about
> this is trivial, but
> this information is well hidden inside the Java
> platform (and no first=20
> page link on Google reckon this), so that it may be
> difficult to find=20
> out (I only found out it by accident, and I was
> pondering to rewrite the=20
> HttpTransportSE class).
>=20
> If you have J2SE 1.4+, the Java Secure Socket
> Extension already allows=20
> you to use HTTPS without calling a different
>=20
> Instead of calling HttpTransportSE with a normal
> http url call it with=20
> an https url.
>=20
> So if you call
> "http://mysoapserver.com/soapservlet", call instead
> (for=20
> example)
> "https://mysoapserver.com:8443/soapservlet".
>=20
> I tested this on Tomcat 5, with a standard SSL
> config (I only gave a=20
> different keystore path and password), and the
> client jar was signed=20
> with a key from the same keystore. The client jar is
> then downloaded via=20
> Java Webstart, j2se/java webstart will allow you to
> connect to the=20
> server without any problem.
>=20
> See:
>=20
>
http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html=
#HTTPSSample
>
http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html
> for further information on jsse, and
>=20
>
http://ksoap.enhydra.org/software/downloads/addon/HttpTransportSE.java
> for the HttpTransportSE class (present both in
> ksoap-j2ee and ksoap-j2se=20
> jars).
>=20
> Please, blog this, link this post either on GMane or
> on the Enhydra=20
> website archives and spread the love for KSoap :)
>=20
> --=20
> Davide Inglima - limaCAT
> mailto:[email protected]
>=20
>=20
> _______________________________________________
> Ksoap mailing list
> [email protected]
> http://www.enhydra.org/mailman/listinfo.cgi/ksoap



=09
	=09
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25=A2
http://photos.yahoo.com/ph/print_splash