SendDataOverMQTT using TLS fails
Antwort
10.04.19 22:39

 Hi,

 

I modified the sample SendDataOverMQTT in Workbench version 3.6.0 to connect to my mqtt broker using TLS.

When I run the app I see my root CA certificate is loaded. But I see the following exception

INFO | XDK DEVICE 1: IP address of device  172.20.10.10
 INFO | XDK DEVICE 1:               Mask    255.255.255.240
 INFO | XDK DEVICE 1:               Gateway 172.20.10.1
 INFO | XDK DEVICE 1:               DNS     172.20.10.1
 INFO | XDK DEVICE 1: WLANPersonalWPA2Connect : Connected to WPA network successfully. 
 INFO | XDK DEVICE 1: cert. version     : 3
 INFO | XDK DEVICE 1: serial number     : 00
 INFO | XDK DEVICE 1: issuer name       : C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2
 INFO | XDK DEVICE 1: subject name      : C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2
 INFO | XDK DEVICE 1: issued  on        : 2009-09-01 00:00:00
 INFO | XDK DEVICE 1: expires on        : 2037-12-31 23:59:59
 INFO | XDK DEVICE 1: signed using      : RSA with SHA-256
 INFO | XDK DEVICE 1: RSA key size      : 2048 bits
 INFO | XDK DEVICE 1: basic constraints : CA=true
 INFO | XDK DEVICE 1: key usage         : Key Cert Sign, CRL Sign
 INFO | XDK DEVICE 1: crt content:498  . Setting up the SSL/TLS structure... ok success
 INFO | XDK DEVICE 1:   !  mbedtls_x509_crt_parse Succeeded
 INFO | XDK DEVICE 1: AppController: Client id of the device: d:XDK_XX_XX_05_A3_XX_XX
 INFO | XDK DEVICE 1: SntpSentCallback : Success
 INFO | XDK DEVICE 1: SntpTimeCallback : received
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Step 20 
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Step 30 
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Step 40 isSecure 
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Step 50 
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Password XXXXXXXXXXXXXXXXXXXX
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Username XXXXXXXXXXXXXXXXXXXX 
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Target (null) 
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Port 45858 
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : ClientId d:XDK_XX_XX_05_A3_XX_XX 
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Url mqtts://myMqttbroker:8883 
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Step 60 , return code: 0 
 INFO | XDK DEVICE 1:         14 [SSL:1] Sec_receiveCB: HORRIBLE Buffer full state=1 (0x200020b8)
 INFO | XDK DEVICE 1:         15 [SSL:1] Sec_receiveCB: HORRIBLE Buffer full state=1 (0x200020b8)
 INFO | XDK DEVICE 1:         15 [SSL:1] Sec_receiveCB: HORRIBLE Buffer full state=1 (0x200020b8)
 INFO | XDK DEVICE 1:         15 [SSL:1] Sec_receiveCB: HORRIBLE Buffer full state=1 (0x200020b8)
 INFO | XDK DEVICE 1:         15 [SSL:1] Sec_receiveCB: HORRIBLE Buffer full state=1 (0x200020b8)
 INFO | XDK DEVICE 1:         16 [SSL:1] Sec_receiveCB: HORRIBLE Buffer full state=1 (0x200020b8)
 INFO | XDK DEVICE 1: MQTT_ConnectToBroker : Failed since Connect event was not received 
 INFO | XDK DEVICE 1: AppControllerFire : MQTT connection to the broker failed 
 INFO | XDK DEVICE 1: Error in XDK110 Application package.
 INFO | XDK DEVICE 1: 	Package ID: 153
 INFO | XDK DEVICE 1: 	Module ID: 39
 INFO | XDK DEVICE 1: 	Severity code: 2
 INFO | XDK DEVICE 1: 	Error code: 121

When I run the sample client on the XDK to connect to test.mosquitto.org it works.

At the same time I verified the used root CA certificate and all my connection parameters using the MQTT client tool mqtt spy and this works without problem.

 

What do I have to change?

What does the msg  16 [SSL:1] Sec_receiveCB: HORRIBLE Buffer full state=1 (0x200020b8) indicate?

--Christof

0 (0 Stimmen)
RE: SendDataOverMQTT using TLS fails
Antwort
15.04.19 07:47 als Antwort auf Christof Strack.

Hello Christof,

Considering your certificate size required by the broker, increasing MBEDTLS_SSL_MAX_CONTENT_LEN macro value from 4850 to 5950 in Common/ config/ MbedTLS/ MbedtlsConfigTLS.h solves the buffer error for "cumulocity broker".

 

0 (0 Stimmen)