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

Thingworx C SDK on Linux- socket connection. Err = 111

  • March 8, 2018
  • 4 replies
  • 2611 views

I am using Thingworx C SDK on linux to communicate with thingworx internal server, but i am getting following error.

[FORCE] 2018-03-08 03:54:52,672: Starting up...
[WARN ] 2018-03-08 03:54:52,683: SDK Version: 2.0.2
[WARN ] 2018-03-08 03:54:52,683: TLS Library: OpenSSL
[WARN ] 2018-03-08 03:54:52,683: TLS Library Version: 1.0.2l
[DEBUG] 2018-03-08 03:54:52,683: twWs_Create: Initializing Websocket Client for zbdpyqlt.studio-trial.thingworx.io:8443//Thingworx/WS
[DEBUG] 2018-03-08 03:54:52,683: twTlsClient_Create: Initializing TLS Client
[DEBUG] 2018-03-08 03:54:53,111: twApi_Initialize: Websocket Established after 0 tries
[DEBUG] 2018-03-08 03:54:53,113: subscribedPropsMgr_Initialize: Initializing subscribed properties manager
[DEBUG] 2018-03-08 03:54:53,129: added SteamSensorThing to boundList
[DEBUG] 2018-03-08 03:54:53,130: twApi_BindThings: not currently connected, only binding things to api
[DEBUG] 2018-03-08 03:54:53,131: twMessage_Delete: Deleting BIND Message: 1
[TRACE] 2018-03-08 03:54:53,132: twApi_Connect: Delaying 1 milliseconds before connecting
[DEBUG] 2018-03-08 03:54:53,134: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2018-03-08 03:54:53,136: twTlsClient_Connect: Connecting to server
[ERROR] 2018-03-08 03:54:53,136: Error intializing socket connection. Err = 111
[ERROR] 2018-03-08 03:54:53,137: twWs_Connect: Error restarting socket. Error 111
[DEBUG] 2018-03-08 03:54:58,137: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2018-03-08 03:54:58,139: twTlsClient_Connect: Connecting to server
[ERROR] 2018-03-08 03:54:58,139: Error intializing socket connection. Err = 111
[ERROR] 2018-03-08 03:54:58,139: twWs_Connect: Error restarting socket. Error 111
[DEBUG] 2018-03-08 03:55:03,140: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2018-03-08 03:55:03,141: twTlsClient_Connect: Connecting to server
[ERROR] 2018-03-08 03:55:03,142: Error intializing socket connection. Err = 111
[ERROR] 2018-03-08 03:55:03,142: twWs_Connect: Error restarting socket. Error 111
[ERROR] 2018-03-08 03:55:08,142: twApi_Connect: Max number of connect retries: 3, has been reached

 

The connection works well if i connect to the cloud server, but i want to connect to the internal server.

What could be the issue with the internal server?

Do i need to add any SSL certificate for the internal server or Do i need to change any configuration?

 

Regards,

Bhau

4 replies

5-Regular Member
March 8, 2018

Hi, Bhau.

 

This certainly looks like an SSL error. You can verify that by temporarily disabling SSL in the C-SDK.

 

This post describes how to accomplish that, and also very correctly warns about never doing this on a system intended for Production or otherwise exposed. If it does work after disabling SSL check the certificate chain to find anything missing (maybe intermediate certificates?) and re-enable SSL as soon as possible.

 

Thanks,

 

-- Craig A.

Bhau1-VisitorAuthor
1-Visitor
March 13, 2018

Hi,

 

How do i add SSL certificates in C-SDK?

 

Regards,

Bhau

12-Amethyst
March 13, 2018

Hi @Bhau,

 

Error 111 is a 'Connection Refused' error on Linux, so the edge agent isn't able to connect because the platform is refusing the request.  Sounds like something may be misconfigured on your Tomcat instance.

Bhau1-VisitorAuthor
1-Visitor
March 26, 2018

I tried to ping the server from the linux machine that am using as a client and got the following response.

 

PING zbdpyqlt.studio-trial.thingworx.io (34.203.75.210) 56(84) bytes of data.

^C

--- zbdpyqlt.studio-trial.thingworx.io ping statistics ---

82 packets transmitted, 0 received, 100% packet loss, time 81054ms

 

does this some kind of firewall issue? 

 

regards,

Bhau