org.apache.http.conn.HttpHostConnectException: Connection to https://jazz.net refused - ibm-mobilefirst

i have upgraded my worklight with 5.0.5 to 5.0.6 .when i have worked on 5.0.5 it worked fine but the same code when i am using in updated version worklight 5.0.6 it gives me this error
response [/apps/services/api/RTMLight/common/query] success: /-secure-
{"responseID":"2","errors":["Runtime: Http request failed: org.apache.http.conn.HttpHostConnectException: Connection to https://jazz.net refused"],"isSuccessful":false,"warnings":[],"info":[]}/
worklight.js (line 1112)
Procedure invocation error. Runtime: Http request failed: org.apache.http.conn.HttpHostConnectException: Connection to https://jazz.net refused

This does not sound related to any upgrade issue between 5.0.5 to 5.0.6. From the error message this seems more related to connectivity issues.
Make sure that your adapter's connectionPolicy uses the port child-element with value 443, like this:
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>https</protocol>
<domain>jazz.net</domain>
<port>443</port>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2" />
</connectivity>

Related

JMX connection to access MBean

My environment:
O/S: Windows 8.1
JRE: 1.7
Eclipse: Luna, 4.4
Worklight: 6.2 (build 6.2.0.00-20140801-1709)
I have encountered the following error when Run As > Run on Worklight Development Server.
I've re-installed several times, but the error persist.
Another strange thing noted: Need to change the <httpEndpoint host="*" to host="hostname" ...> in the server.xml before the Worklight Server can be started.
Questions:
Is there any similar problem?
Is Worklight Studio tested on Windows 8.1? (based on Announcement Letter, Worklight is only supported on Windows 8)?
[ERROR ] Failed to obtain JMX connection to access an MBean. There
might be a JMX configuration error: Connection refused: connect
[ERROR ] Failed to obtain JMX connection to access an MBean. There
might be a JMX configuration error: FWLSE3012E: JMX configuration
error. Unable to obtain MBeans. Reason: "Connection refused: connect".
[ERROR ] FWLSE3000E: A server error was detected. FWLSE3012E: JMX
configuration error. Unable to obtain MBeans. Reason: "FWLSE3012E: JMX
configuration error. Unable to obtain MBeans. Reason: "Connection
refused: connect"
Did you try the solutions provided in the following questions?
IBM Worklight 6.2: JMX configuration error. Unable to obtain MBeans
Also try with JRE 1.6 (make sure Eclipse is configured to use it, too)

Worklight https adapter call "https refused" [duplicate]

This question already has an answer here:
Making web service calls to a HTTPS server from Worklight Adapter - javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
(1 answer)
Closed 4 years ago.
Could not able to get response from HTTPS Adapter call .
My code as follows
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>https</protocol>
<domain>my domain</domain>
<port>443</port>
<sslCertificateAlias>MRDSE</sslCertificateAlias>
<sslCertificatePassword>testpwd</sslCertificatePassword>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2" />
</connectivity>
Getting error as
""errors": [
"Runtime: Http request failed: javax net SSLPeerUnverifiedException: peer not authenticated"
],"
I Have also mentioned in work light properties
ssl.keystore.path=conf/rc.keystore
ssl.keystore.type=jks
ssl.keystore.password=mypwd
Please suggest to get HTTPS response
Did you put the certificate in the keystore?
Also, please refer to this answer to an almost identical question: https://stackoverflow.com/a/21914147/2245921

IBM Worklight 6.1 - Runtime: Http request failed: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

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.
I got the answer for my problem.
Clean worklight development server
Deploy worklight adapter
No issue regarding to SSL.
Done
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).
I solved this problem by ensuring Eclipse is pointing to Java 7 as opposed to Java 6.

IBM Worklight 6.0 - Mixed port numbers after enabling console login authentication?

Wishing to have a Worklight Console Authentication I followed the infocenter instructions from this link at infocenter.It seems to be working at the first glance as entering the console it prompts the login form.
Going to the console URL at http://192.168.168.154:9080/finance/console/#catalog it brings the login page right away. So far so good.
After entering the right username/password (both defined at worklight.properties) the login page redirects to the Worklight console at port 10080 and fails to load the page
Unable to connect
Firefox can't establish a connection to the server at 192.168.168.154:10080.
As you can read it tries to connect to http://192.168.168.154:10080/finance/console. It should not happen I guess, as port 10080 was not configured.
I have no idea why it is redirecting to this port. I searched inside the config files for 10080 and could not find any reference to it. I think somehow WL is getting this 10080 as a default as it is the port used for development.
Here is the files snippets I am using to enable Login Console:
worklight.properties:
#publicWorkLightHostname=localhost
# http or https
#publicWorkLightProtocol=http
# For default port leave empty
#publicWorkLightPort=10080 <-- it is commented out
console.username=finance
console.password=finance
authenticationConfig.xml
<staticResources>
<resource id="worklightConsole" securityTest="WorklightConsole">
<urlPatterns>/console*</urlPatterns>
</resource>
....
</staticResources>
<securityTests>
<customSecurityTest name="WorklightConsole">
<test realm="WorklightConsole" isInternalUserID="true"/>
</customSecurityTest>
...
</securityTests>
server.xml
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9080"
httpsPort="9443" >
<tcpOptions soReuseAddr="true"/>
</httpEndpoint>
<!-- Declare the JNDI properties for the IBM Worklight Console. -->
<jndiEntry jndiName="worklight/publicWorkLightProtocol" value='"http"'/>
<jndiEntry jndiName="worklight/publicWorkLightPort" value='"9080"'/>
<jndiEntry jndiName="worklight/serverSessionTimeout" value='"10"'/>
Any idea on how to solve this port mismatch issue ? Env is WL 6.0 on Liberty
P.S: Later on we plan to user LDAP instead. For now, having the username/passaword in the properties would suffice.
In worklight.properties, uncomment the #publicWorkLightPort=10080 property and change it to 9080.
worklight.properties is part of the Worklight project's .war file that is deployed into the application server; the application server may have its own port number set in server.xml, but the .war (project) has some specific properties of its own.
During my testing I encountered the same issue, but once uncommenting and changing the port value in worklight.properties, the re-direct then worked properly after logging-in.

org.apache.http.conn.HttpHostConnectException

I am getting the following error when i am trying to connect to a url https://jazz.net on worklight 5.0.6..
Procedure invocation error. Runtime: Http request failed:
org.apache.http.conn.HttpHostConnectException: Connection to
https://jazz.net refused
This is the response I am getting in log:
{"responseID":"6","errors":["Runtime: Http request failed:
org.apache.http.conn.HttpHostConnectException: Connection to
https://jazz.net
refused"],"isSuccessful":false,"warnings":[],"info":[]}*/
Here is the adapter xml code:
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>https</protocol>
<domain>jazz.net</domain>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2" />
</connectivity>
You need to also add a child-element port with the value 443.