2 Replies Latest reply: Sep 23, 2011 1:55 PM by dark_light_555 RSS

    Problems with getting "Secure Connection"

      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);
      mDisplay.setCurrent(a, mForm);
      // httpsConnection.close();