AnsweredAssumed Answered

Handshake failed in the MQTT TLS_Connect function

Question asked by Stanley Lui on Aug 12, 2019
Latest reply on Aug 15, 2019 by Sabina Bruce

I ran the lpc54018iotmodule_aws_led_wifi_qspi_xip Debug operation using the MCUXpresso IDE and obtained the following console messages:


0 112 [Tmr Svc] Write certificate...
1 228 [Tmr Svc] Write device private key...
2 653 [Tmr Svc] Starting WiFi...
3 2334 [Tmr Svc] WiFi module initialized.
4 4518 [Tmr Svc] WiFi connected to AP Jay's iPhone.
5 4518 [Tmr Svc] IP Address acquired
6 4528 [AWS-LED] [Shadow 0] MQTT: Creation of dedicated MQTT client succeeded.
7 4937 [MQTT] Looked up as
8 22331 [MQTT] ERROR: Handshake failed with error code -1
9 22398 [AWS-LED] [Shadow 0] MQTT: Connect failed.
10 22400 [AWS-LED] Shadow_ClientConnect unsuccessful, returned 2.
11 22402 [AWS-LED] Failed to initialize, stopping demo.



I configured the IoT device in the AWS IoT Console in obtaining the certificate and private key, as well as the endpoint and IoT_Thing_Name. These are updated in the 'aws_clientcrdential_keys.h' and 'aws_clientcredential.h' files.


The handshake error occurs inside the 'mbedtls_ssl_handshake'  within the TLS_Connect function. Any idea for what causing this handshake problem? Appreciate your valuable input!