This discussion is archived
2 Replies Latest reply: Sep 23, 2011 11:55 AM by 800412 RSS

Problems with getting "Secure Connection"

877371 Newbie
Currently Being Moderated
I have built j2me midlet for getting secure connection with server using ssl protocol. I have signed midlet with "Thawte Certificate" and sent "Thawte Premium Server CA" to server in PEM format(Which I have downloaded from Thawte Website ).Checking on WTK emulator it throws "java.io.IOException: getNextMsg refill failed" and "java.io.IOException: error 10054 during TCP read".While checking on S40 6th edition emulator it throws "error occured whilst opening connection" same thing in mobile Nokia x3-02 , is there settings required on nokia device or any certficate issue on server side???

piece of code is given here.. Kindly reply soon...


String urlSecure = "ssl://server ip : port";
SecurityInfo securityInfo = null;
Certificate certificate = null;
SecureConnection secureConnection = null;
HttpsConnection httpsConnection = null;
InputStream inputStream = null;
try {
// httpsConnection=(HttpsConnection) Connector.open(urlSecure);
secureConnection = (SecureConnection) Connector.open(urlSecure);

// securityInfo = httpsConnection.getSecurityInfo();
securityInfo = secureConnection.getSecurityInfo();

certificate = securityInfo.getServerCertificate();
logger.log(certificate.getIssuer() + ""
+ certificate.getSigAlgName() + ""
+ certificate.getSerialNumber());
String subject = certificate.getSubject();
String s = "Server certificate subject: \n" + subject;
s += "\n Issuer:" + certificate.getIssuer() + "\n SigAlgName:"
+ certificate.getSigAlgName() + "\n SerialNumber:"
+ certificate.getSerialNumber();
Alert a = new Alert("Result", s, null, null);
a.setTimeout(Alert.FOREVER);
mDisplay.setCurrent(a, mForm);
secureConnection.close();
// httpsConnection.close();

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points