Skip to main content
1-Visitor
November 8, 2018
Question

java.net.SocketException caused by connecting to an HTTPS Endpoint.

  • November 8, 2018
  • 1 reply
  • 1620 views

I am developing a service in a thing that sends data to a 3rd Party rest endpoint through https.  And I get this error: 

Wrapped java.net.SocketException: Connection reset Cause: Connection reset

 

Here's the javascript for the service below:

 

var url = "https://{url} /{endpoint}";

var content = {
on: true
};

var header = {
Authorization: "Token {key}"
};

 

 

var params = {
headers: header /* JSON */,
url: url /* STRING */,
ignoreSSLErrors: true,
content: content, /* JSON */
};

 

var result = Resources["ContentLoaderFunctions"].GetJSON(params);

 

Any ideas to how this can be solved is appreciated.  Is it possible that Thingworx is ignoring the ignoreSSLErrors flag?  Thanks.

 

1 reply

5-Regular Member
November 13, 2018

Hello,

 

The error appears to be higher level then just a generic SSL error.

The connection is terminated, depending on how it's implemented you could try and catch the exception yourself and discard it, you'd have to check explicitly for this exception though if you want to do this, otherwise other exceptions are discarded also.

 

Is the data successfully send though?

 

Regards,

Pascal

5-Regular Member
November 21, 2018

Hi @pmessina

 

Hope you are doing good. Could you please confirm if the issue has been resolved.

 

If yes, please mark the answer as accept as solution for the future reference. Thank you in advance.

Regards-Mohit Goel