Hi
I was trying to implement HTTPS in MotorolaiDENi730 SDK/EMULATOR.
I am using
JBOSS as my application server. I have enabled https in JBOSS3.2.3 and I can access through the browser
https://localhost/hello/testservlet. But when I try to access through my emulator its throwing exception
The following piece of code I have used to connect the JBoss server.
HttpsConnection hsc = null;
OutputStream os = null;
hsc = (HttpsConnection) Connector.open(conURL,Connector.READ_WRITE, true); hsc.setRequestMethod(HttpConnection.POST);
hsc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
hsc.setRequestProperty("Content-Language", "en-US" );
os = hsc.openOutputStream();
String outputString="sathish kannan";
// Write to the output stream
os.write(outputString.getBytes());
// Send data to server side
os.flush();
// close OutputStream
os.close();
// Close HTTPSConection*/
hsc.close();
Even I have tried with HttpConnection class. Still I am getting the following exception
javax/microedition/pki/CertificateException: <no message>
at com/mot/cldc/io/j2me/https/Protocol::connectSocket(Ljava/lang/String
Ljavax/microedition/io/StreamConnection;+151
at com/mot/cldc/io/j2me/http/StreamConnectionPool::<private method>+302
at com/mot/cldc/io/j2me/http/StreamConnectionPool::getConnection(Lcom/mot/cldc/io/j2me/http/ConnectionBaseAdapter;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;ZZ)Lcom/mot/cldc/io/j2me/http/StreamConnectionElement;+128
at com/mot/cldc/io/j2me/http/Protocol::connect()Ljavax/microedition/io/StreamConnection;+89
at com/mot/cldc/io/j2me/http/Protocol::sendRequest(I)V+113
at com/mot/cldc/io/j2me/http/Protocol::getResponseCode()I+9
at PorticusConnection::getConnectionHTTPS(Ljava/lang/String;Ljava/lang/String
[Ljava/lang/String;+44
at Porticus::genCasinosFromLBS()[Ljava/lang/String;+42
at Porticus::commandAction(Ljavax/microedition/lcdui/Command;Ljavax/microedition/lcdui/Displayable
V+250
at javax/microedition/lcdui/CommandManager::keyReleased(I)Z+181
at javax/microedition/lcdui/DisplayAccessorImpl::keyReleased(I)V+21
at javax/microedition/midlet/AppContext::handleEvent()V+100
at javax/microedition/midlet/AppContext::run()V+396
Do I have to do any other settings in the emulator.
Thanks in advance
Best Regards
-Sathish