Topic
6 replies Latest Post - ‏2013-02-07T10:05:12Z by SystemAdmin
SystemAdmin
SystemAdmin
570 Posts
ACCEPTED ANSWER

Pinned topic Peer not authenticated while trying to connect to a service url

‏2012-03-12T18:23:50Z |
Hi,
I'm trying to connect to a service URL using a HTTP Adapter. below are my configurations.


<connectivity> <connectionPolicy xsi:type=
"http:HTTPConnectionPolicyType"> <protocol>https</protocol> <domain>valid-application-url</domain> <port>12345</port> </connectionPolicy> <loadConstraints maxConcurrentConnectionsPerNode=
"2" />   </connectivity>


In my implementation JS file, I use the below code to invoke the procedure

function authenticateUser()
{ WL.Logger.debug(
"Inside authenticateUser method"); var input = 
{ method : 
'get', returnedContentType : 
'text', headers:
{
'Authorization':
'Basic dGVzdHVzZXI6dGVzdHB3ZA=='
}, path : 
"/test/testservices/services.jsp" 
}; 

return WL.Server.invokeHttp(input); 
}


I'm getting the following exception while invoking the service.


{ 
"errors": [
"Runtime: Http request failed: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated"], 
"info": [], 
"isSuccessful": false, 
"warnings": [] 
}


This site doesn't have a trusted SSL certificated. Will that cause this issue? Can you please help me?

I'm able to access the service from Firefox by setting the headers mentioned in the adapter procedure.
  • AntonAleksandrov
    AntonAleksandrov
    22 Posts
    ACCEPTED ANSWER

    Re: Peer not authenticated while trying to connect to a service url

    ‏2012-03-19T08:35:52Z  in response to SystemAdmin
    Currently Worklight does not supports working with a self-signed certificates. You should either use a certificate from a known CA or switch to HTTP.
    • SystemAdmin
      SystemAdmin
      570 Posts
      ACCEPTED ANSWER

      Re: Peer not authenticated while trying to connect to a service url

      ‏2013-01-02T12:49:59Z  in response to AntonAleksandrov
      Hi,

      Does Worklight still not supports self-signed certificates?

      Thanks
      Baxi
  • SystemAdmin
    SystemAdmin
    570 Posts
    ACCEPTED ANSWER

    Re: Peer not authenticated while trying to connect to a service url

    ‏2012-03-22T02:14:42Z  in response to SystemAdmin
    We have a similar requirement to connect to a secured webservice URL. But we have certificate issued by CA only in Production regions. I created a new keystore in Worklight JRE and added the certificate to that trusted store. But I'm still getting the same exception posted by mailto:mahesh006@gmail.com. I thought it should work, if the certificate is available in the java's keystore. Could you please let us know your thoughts on this?
  • IdanAdar
    IdanAdar
    288 Posts
    ACCEPTED ANSWER

    Re: Peer not authenticated while trying to connect to a service url

    ‏2013-01-02T13:15:07Z  in response to SystemAdmin
    Hello Baxi,
    Please review the following Information Center article related to this subject:

    http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m5/topic/com.ibm.worklight.help.doc/admin/t_ibm_worklight_server_and_self-signed_certificates.html

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • SystemAdmin
      SystemAdmin
      570 Posts
      ACCEPTED ANSWER

      Re: Peer not authenticated while trying to connect to a service url

      ‏2013-02-05T17:01:05Z  in response to IdanAdar
      Hello Idan,

      Thanks for the link. I tested the same by updating the keystore of local WL Server and it worked.

      But I am stuck with remote WL Server, in locating the correct JRE path that came with WebSphere. I just gave a random search with "cacerts" keyword, but there are many that are appearing.

      Could you please suggest as to how I could get the correct path so that I can update the keystore for the same.

      Below is my working environment:
      WL Studio 5.0.5 - Enterprise Edition on Win7
      WL Server 5.0.5 - Enterprise Edition on Red Hat Enterprise Linux
      (Database - Apache Derby, Application server - WebSphere® Application Server Liberty Profile)

      Thanks again,
      Baxi
      • SystemAdmin
        SystemAdmin
        570 Posts
        ACCEPTED ANSWER

        Re: Peer not authenticated while trying to connect to a service url

        ‏2013-02-07T10:05:12Z  in response to SystemAdmin
        Hello,

        Can anyone provide any info regarding the above.

        Thanks,
        Baxi