IBM Worklight 6.1 - Runtime: Http request failed:

2019-08-02 07:11发布

问题:

I'm using IBM worklight 6.1 and backbone.js for my mobile app project. I got this error message when I try invoke the adapter.

Orders.xml

<?xml version="1.0" encoding="UTF-8"?>
<wl:adapter name="Orders"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:wl="http://www.worklight.com/integration"
    xmlns:http="http://www.worklight.com/integration/http">

    <displayName>Orders</displayName>
    <description>Orders</description>
    <connectivity>
        <connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
            <protocol>https</protocol>
            <domain>izify.com</domain>
            <port>443</port>            
        </connectionPolicy>
        <loadConstraints maxConcurrentConnectionsPerNode="2" />
    </connectivity>


    <procedure name="getOrders"> </procedure>

</wl:adapter>

Orders-impl.js

function getOrders() {

    var input = {
        method : 'get',
        returnedContentType : 'json',
        path : "api/izify-api/admin/get_all_orders.php",
        parameters:{merchantId:"74718912a2c0d82feb2c14604efecb6d"}
    };

    return WL.Server.invokeHttp(input);
}

ERROR message

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

Thanks a lot in advance.

回答1:

I got the answer for my problem.

  • Clean worklight development server
  • Deploy worklight adapter

No issue regarding to SSL.

Done



回答2:

Sometimes this exception occurs when the JVM doesn't trust the certificate. It's one of several symptoms of a problem negotiating the SSL/https connection.

Sometimes this happens when the remote server has an issue with its SSL certificate. However, from my end I am unable to recreate with an Oracle 1.7 JVM with unmodified trust stores - I can retrieve https://izify.com/api/izify-api/admin/get_all_orders.php and get back a response.

I also verified with a 3rd party certificate checker that there are no problems with the izify.com SSL certificate (other than it expires soon, but that won't be a problem for a few months now). Please run this from your end and confirm the IP address they resolve matches what you do.

Then, check that your WL server's HTTP requests to izify.com aren't going through some sort of proxy that is redirecting or otherwise interrupting the SSL connection (for example, Fiddler or development proxy).



回答3:

I solved this problem by ensuring Eclipse is pointing to Java 7 as opposed to Java 6.