Other Parts Discussed in Thread: CC3200, UNIFLASH
Hi,
- I'm currently using TI's CC3200 Launchpad as a part of a project that uses MQTT to connect securely to AWS IOT broker.
- Im using FreeRTOS (not TI_RTOS) and successfully tested FreeRTOS_Demo and WLAN_station example applications that comes with the SDK
- I then moved into the MQTT_Client example and succesfully connected to "iot.eclipse.org" without security.
with security
- (before moving into AWS broker) by doing the following :-
- Downloaded the DST root CA certificate by openssl command : openssl s_client -showcerts -CApath /etc/ssl/certs/ -connect iot.eclipse.org:8883
- After I typed this command, 2 certificates were printed on the terminal window and I chose the one which said i:/O=Digital Signature Trust Co./CN=DST Root CA X3 and copy pasted the certificate as seen on the terminal windows (starting with BEGIN CERTIFICATE and ending with END CERTIFICATE) into a .pem file . (Am I wrong here itself ? )
- From other forums,I understood that the certificate needs to be flashed in .der format, so converted the .pem file into .der using the command openssl x509 -outform der -in certificate.pem -out certificate.der
- The DER file was flashed into the serial Flash of CC3200 using the UNIFLASH TOOL. I didn't find much documentation on how to add a certificate into a particular location but I figured it out that by using the option 'ADD FILES', one could add a file into any location, so I did add my .der file to the location with the name field as /certs/dst.der and checking the options Erase, update and verify and finally it was successfully programmed into the flash. ( Am I wrong here too ?)
Now, coming back to the program, the following changes were made based on this https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/p/417213/2212382?tisearch=e2e-sitesearch&keymatch=mqtt%20secure#2212382
#define SERVER_ADDRESS "iot.eclipse.org" //No change btw
#define PORT_NUMBER 8883
#define SL_SSL_CA_CERT "/cert/dst.der"
char *security_file_list[4] = {NULL,NULL,SL_SSL_CA_CERT,NULL};
/* connection configuration */
connect_config usr_connect_config[] =
{
{
{
{
SL_MQTT_NETCONN_URL|SL_MQTT_NETCONN_SEC,
SERVER_ADDRESS,
PORT_NUMBER,
SL_SO_SEC_METHOD_SSLv3_TLSV1_2,
SL_SEC_MASK_SECURE_DEFAULT,
4,
security_file_list
},
SERVER_MODE,
true,
},
NULL,
"uusseerr",
NULL,
NULL,
true,
KEEP_ALIVE_TIMER,
{Mqtt_Recv, sl_MqttEvt, sl_MqttDisconnect},
TOPIC_COUNT,
{TOPIC1, TOPIC2, TOPIC3},
{QOS2, QOS2, QOS2},
{WILL_TOPIC,WILL_MSG,WILL_QOS,WILL_RETAIN},
false
}
};
Running this I get the following Error as seen in Tera term
Host Driver Version: 1.0.0.10
Build Version 2.4.7.2.31.1.3.4.1.1.5.3.34
Device is configured in default state
Started SimpleLink Device: STA Mode
[WLAN EVENT] STA Connected to the AP: PWIFI , BSSID: 8:86:3b:d7:cd:da
[NETAPP EVENT] IP acquired by the device
Device has connected to PWIFI
Device IP Address is 192.168.2.172
Time set to : 15/03/2018 00:10:30
Version: Client LIB 1.0.3, Common LIB 1.1.1.
Blocking an network for (finite) 30 secs to monitor 1 fd(s)
ERROR: Could not establish connection to server.
ERROR: Closing the socket.
Broker connect fail for conn no. 1
Exiting the Application
I tried changing the cipher suites but it was of no use . Where did it possibly go wrong ?
[SDK version is 1.1.0 and service pack version is 1.0.0.10.0]