I am developing a J2ME application with Eclipse, Sun Wireless
Toolkit 2.3, and the Eclipse ME plugin. I have placed all network
code in its own thread separate from the GUI thread as the emulator
suggested. I want to establish an SSL connection to a server without
using HTTPS. So I write
SecureConnection sc = Connector.open("ssl: ...
The connection is open, and from the Ethereal packet sniffer
application I can see the first three phases of the handshake.
After sending data to the server, receiving a certificate, and
sending 14 bytes back the connection is closed, so that it
never gets to the reading data part of the application. This
happens both on Sun's emulator as well as on various
The only emulator where I was able to get past this point
is the blackberry, where i can receive 2000 bytes or so,
but after that InputStream instance is method is.available()
returns zero, no more bytes are read from the network,
and alas, is.read() returns junk data and I don't know
what to do about it.
So, is there a way to get things to work on the
Nokias at least? For instance, under Sun Java
WIreless Toolkit 2.3 Beta -> Utilities I can see
a Manage Certificates button with the Security
options. Do I need to do something here to
allow the application to proceed past the
send/receive/send sequence i described
earlier? What exactly should I do here,
if this is what's causing the problem?
Any feedback or experiences with this SSL
on J2ME would be really appreciated, as I
am really eager to get this working on at
least one emulator and/or hardware device,
don't care which, but would really like to
see SSL working properly on at least
one mobile Java application.
I will be eternally grateful to whever can
provide me with some feedback on this.
Thanks a lot!