Other Parts Discussed in Thread: UNIFLASH
Tool/software: TI-RTOS
I am getting the below exception while connecting to secure MQTT server using RootCA certificate alone and client user and password. The certificate(in der format) is uploaded in the device using UniFlash.
We are using the latest SDK version, the examples inside the latest SDK and CCS 7.3.0
These are the configuration we are using in the code:
#define SECURE_CLIENT #define CLNT_USR_PWD #define CLIENT_NUM_SECURE_FILES 4 char *Mqtt_Client_secure_files[CLIENT_NUM_SECURE_FILES] = {NULL, NULL, "/cert/cacert.der", NULL};
#ifdef CLNT_USR_PWD /* Set user name for client connection */ MQTTClient_set(gMqttClient, MQTT_CLIENT_USER_NAME, (void *)ClientUsername, strlen((char*)ClientUsername)); /* Set password */ MQTTClient_set(gMqttClient, MQTT_CLIENT_PASSWORD, (void *)ClientPassword, strlen((char*)ClientPassword)); #endif
MQTTClient_NetAppConnParams_t Mqtt_ClientCtx = { MQTTCLIENT_NETCONN_URL | MQTTCLIENT_NETCONN_SEC, SERVER_ADDRESS, SECURED_PORT_NUMBER, SL_SO_SEC_METHOD_SSLv3_TLSV1_2, SL_SEC_MASK_SECURE_DEFAULT, CLIENT_NUM_SECURE_FILES, Mqtt_Client_secure_files };
This is the error from the Debug Terminal :
************************************************* CC3220 MQTT client Application ************************************************* Device came up in Station mode [WLAN EVENT] STA Connected to the AP: opelzac , BSSID: 44:d9:e7:67:b:77 [NETAPP EVENT] IP acquired by the device Device has connected to opelzac Device IP Address is 192.168.1.13 Version: Client LIB 1.1.0, Common LIB 1.2.0. ..[SOCK EVENT] - Unexpected Event [20x] Connection to broker failed On-board Client Disconnected