cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

[Raspberry pi 3+ ]WS EMS SSL connection and self-signed certficate

GF_9594158
6-Contributor

[Raspberry pi 3+ ]WS EMS SSL connection and self-signed certficate

hi all 

 

im strugling tring to connect with SSL my raspyberry pi 3+. Without SSL i didn't face with errors but actually i get always the following error:

 

 

root@raspberrypi:/home/pi/Downloads/microserver# ./wsems
[FORCE] 2021-06-03 15:33:23,883 ./wsems: Initializing EMS ....
[FORCE] 2021-06-03 15:33:23,883 main: Using config file /home/pi/Downloads/microserver/etc/config.json
[INFO ] 2021-06-03 15:33:23,883 ./wsems: Creating the WsEms proxy.
[DEBUG] 2021-06-03 15:33:23,883 DutyCycle::calculateDutyCycleTimePeriods: m_ConnectPeriod: 60000
[DEBUG] 2021-06-03 15:33:23,883 DutyCycle::calculateDutyCycleTimePeriods: m_DisconnectPeriod: 0
[INFO ] 2021-06-03 15:33:23,883 ./wsems: Starting HTTP Server.
[WARN ] 2021-06-03 15:33:23,883 Main: Encryption is disabled on HTTP Server.
[WARN ] 2021-06-03 15:33:23,884 Main: TLS Hostname Validation Is Disabled
[WARN ] 2021-06-03 15:33:23,884 Main: Authentication is disabled on the HTTP Server.
[INFO ] 2021-06-03 15:33:23,884 ./wsems: Initializing the ThingWorx REST interface.
[FORCE] 2021-06-03 15:33:23,884 httpServer: starting http server port=9000
[INFO ] 2021-06-03 15:33:23,884 wsEmsProxy::initialize: FIPS is disabled.
[INFO ] 2021-06-03 15:33:23,885 wsEmsProxy::initialize: Encryption is enabled on Web Socket connection.
[DEBUG] 2021-06-03 15:33:23,885 wsEmsProxy::initialize: EMS Duty Cycle configuration from config.json:
[DEBUG] 2021-06-03 15:33:23,885 wsEmsProxy::initialize: m_DutyCycle.setDutyCyclePeriod: 60000
[DEBUG] 2021-06-03 15:33:23,885 wsEmsProxy::initialize: m_DutyCycle.setDutyCyclePercent: 100
[DEBUG] 2021-06-03 15:33:23,886 wsEmsProxy::initialize: m_DutyCycle.setConnectTimeout: 10000
[DEBUG] 2021-06-03 15:33:23,886 wsEmsProxy::initialize: m_DutyCycle.setConnectRetries: -1
[DEBUG] 2021-06-03 15:33:23,886 wsEmsProxy::initialize: m_DutyCycle.setDelayDutyCycle: 60000
[DEBUG] 2021-06-03 15:33:23,886 jsonConfigurator::getJsonEntity: Key fingerprint_whitelist not found
[WARN ] 2021-06-03 17:33:23,886 SDK: SDK Version: 2.2.11
[WARN ] 2021-06-03 17:33:23,887 SDK: TLS Library: OpenSSL
[WARN ] 2021-06-03 17:33:23,887 SDK: TLS Library Version: 1.1.1c
[DEBUG] 2021-06-03 17:33:23,887 SDK: twWs_Create: Initializing Websocket Client for 10.0.0.4:443/Thingworx/WS
[DEBUG] 2021-06-03 17:33:23,887 SDK: twTlsClient_Create: Initializing TLS Client
[DEBUG] 2021-06-03 15:33:23,888 httpServer: http server bound to port=9000.
[DEBUG] 2021-06-03 17:33:23,900 SDK: twApi_Initialize: Websocket Established after 0 tries
[DEBUG] 2021-06-03 17:33:23,900 SDK: subscribedPropsMgr_Initialize: Initializing subscribed properties manager
[INFO ] 2021-06-03 15:33:23,900 WsProxy::initialize: EMS Version 5.4.9.1154
[INFO ] 2021-06-03 15:33:23,900 WsProxy::initialize: twApi singleton initialized
[WARN ] 2021-06-03 15:33:23,900 WsProxy::initialize: Certificate validation is disabled.
[DEBUG] 2021-06-03 15:33:23,900 jsonConfigurator::getJsonEntity: Key validation_criteria not found
[DEBUG] 2021-06-03 17:33:23,901 SDK: twTunnelManager_Create: Tunnel Manager singleton already exists
[DEBUG] 2021-06-03 17:33:23,902 SDK: added PeppeRaspberryTest to boundList
[DEBUG] 2021-06-03 17:33:23,902 SDK: twApi_BindThings: not currently connected, only binding things to api
[DEBUG] 2021-06-03 17:33:23,902 SDK: twMessage_Delete:  Deleting BIND Message: 1
[INFO ] 2021-06-03 15:33:23,902 WsEmsProxy::registerVirtualDirs: Adding virtual dir in: /home/pi/downloads/in
[INFO ] 2021-06-03 15:33:23,903 WsEmsProxy::registerVirtualDirs: Adding virtual dir out: /home/pi/downloads/out
[INFO ] 2021-06-03 15:33:23,903 wsEmsProxy::initialize: Initialization complete!
[INFO ] 2021-06-03 15:33:23,904 ./wsems: Starting the connection.

10.0.0.4:443-->[DEBUG] 2021-06-03 17:33:31,918 SDK: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2021-06-03 17:33:31,919 SDK: twTlsClient_ConnectSession: Connecting to server
[ERROR] 2021-06-03 17:34:02,77 SDK: twTlsClient_ConnectSession: Error initializing socket connection. Err = 115
[ERROR] 2021-06-03 17:34:02,77 SDK: twWs_Connect: Error restarting socket.  Error 115
[DEBUG] 2021-06-03 17:34:07,78 SDK: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2021-06-03 17:34:07,78 SDK: twSocket_Close: socket is already closed or was never opened
[DEBUG] 2021-06-03 17:34:07,78 SDK: twTlsClient_ConnectSession: Connecting to server
^C
root@raspberrypi:/home/pi/Downloads/microserver#

 

 

 

 

 

i've uploaded my files:

- config.lua

- config.json

- template

1 ACCEPTED SOLUTION

Accepted Solutions
slangley
23-Emerald II
(To:GF_9594158)

Hi @GF_9594158 

From a review of the files you provided, it doesn't appear you have configured your certificate.  Since you're trying to use a self-signed certificate, the config.json also needs to be updated to allow self-signed certificates.  Here's an article that may help.

 

Is ThingWorx running SSL?

 

Regards.

 

--Sharon

View solution in original post

2 REPLIES 2
slangley
23-Emerald II
(To:GF_9594158)

Hi @GF_9594158 

From a review of the files you provided, it doesn't appear you have configured your certificate.  Since you're trying to use a self-signed certificate, the config.json also needs to be updated to allow self-signed certificates.  Here's an article that may help.

 

Is ThingWorx running SSL?

 

Regards.

 

--Sharon

GF_9594158
6-Contributor
(To:slangley)

I fixed it.. thank u 

Top Tags