×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    38

    Question javax.microedition.pki.CertificateException

    Hello,

    I'm developing a J2ME application to communicate with a Web Service.
    When I run the midlet, i got the error:
    javax.xml.rpc.JAXRPCException: javax.microedition.pki.CertificateException: Subject alternative name did not match site name
    at com.sun.j2mews.xml.rpc.OperationImpl.invoke(+220)
    at service_now.incidents.ServiceNowSoap_Stub.getKeys(+540)

    Following is my code:

    protected void startApp() throws MIDletStateChangeException {
    try {
    ServiceNowSoap_Stub proxy = new ServiceNowSoap_Stub();
    proxy._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "abc");
    proxy._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "abc");
    proxy._setProperty(javax.xml.rpc.Stub.SESSION_MAINTAIN_PROPERTY, new Boolean(true));

    GetKeys getInc = new GetKeys();
    getInc.setActive(Boolean.TRUE);
    getInc.setCategory("hardware");

    GetKeysResponse resp = new GetKeysResponse();
    resp = proxy.getKeys(getInc);

    String[] keys = resp.getSys_id();
    } catch (RemoteException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    The error appear at the line: resp = proxy.getKeys(getInc);

    I tried to make an application in J2EE to communicate with this web service and everything was fine, I didn't have any error.
    I set the same properties to the Stub such as: ENDPOINT_ADDRESS_PROPERTY, USERNAME_PROPERTY, PASSWORD_PROPERTY.

    Could someone please tell me what is wrong?
    I really need your help!

    Thank you very much for replying.

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2003
    Posts
    4,104
    Does this help?
    Quote Originally Posted by burinutit View Post
    I really need your help!
    Nokia offers paid technical support for everyone …

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    38

    Re: javax.microedition.pki.CertificateException

    Thank you traud, i'll think about it maybe later.

    For this problem I already got the answer. The thing is the mobile emulators cannot recognize the second level of domain name in the certificate (e.g. *.webservice.com). That's why when you connect to an address like my.webservice.com, you will get the exception "javax.microedition.pki.CertificateException: Subject alternative name did not match site name".

    If I use Sun Java(TM) Wireless Toolkit 2.5.2_01 for CLDC, I'll get the exception and cannot run the code.
    But if I use S60 3rd Edition SDK for Symbian OS FP2 v1.1, I can still run the application and have the option to accept the certificate or not.

    For now, I'm using the workaround by accepting the certificate with the S60 Emulator.

    If anybody has a better solution, I'll be very happy to know about it.

    Thanks and Best regards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •