0 Replies Latest reply: Feb 13, 2013 10:23 PM by 975608 RSS

    Could not match host name in server certificate

      I got the following error while trying to implement my own CredentialManager on a JavaCard applet
      java.io.IOException: java.lang.Exception: Could not match host name <localhost> to name <C=US;ST=California;L=Santa Clara;O=Oracle Corporation;OU=GlassFish;CN=localhost-instance> in server certificate
      My code
      public class TestApplet extends Applet {
          public static void install(byte[] bArray, short bOffset, byte bLength) {
              new TestApplet();
          protected TestApplet() {
              CredentialManager.setCredentialManager(new TestCredentialManager(), CredentialManager.MODE_GCF_CLIENT);
          public void process(APDU apdu) {
              try {
                  SecureConnection c = (SecureConnection)Connector.open("ssl://localhost:433"); //exception occurs here
              } catch(IOException ex) {
      TestCredentialManager is a class that extends CredentialManager and implements all the abstract methods, all return null except for methods that returns void.

      How to solve this? Thanks in advance.