aws / aws-iot-device-sdk-embedded-C

SDK for connecting to AWS IoT from a device using embedded C.
MIT License
977 stars 623 forks source link

aws_iot_shadow_connect(&mqttClient, &scp) always returning "-28" #1913

Open pranoyd-nd opened 1 month ago

pranoyd-nd commented 1 month ago

Hi,

We are experiencing an issue while trying to connect to AWSIOT shadow where the return code is always "-28" (MQTT_REQUEST_TIMEOUT_ERROR)

The below are some key observations:

Version: https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v2.1.1

Kindly help to understand what is the issue with the certificates. As the MQTT_REQUEST_TIMEOUT_ERROR may temporarily come due to actual connection timeout, we are not considering this return code (-28) as a trigger to reset the certificate and private key. Kindly suggest how we can differentiate this behaviour with genuine timeouts so that we can effectively handle this issue.

archigup commented 1 month ago

Do those certificates work with a different SDK? If the cert is rejected from cloud side, we wouldn't know if it was due to invalid cert. Though, as far as I know, in that case IoT Core kills the connection, so I would expect a connection killed and not timed out. Are you able to see the connection attempts cloud side? You could enable Device Defender and see if it reports failed connection attempts for your Thing.

Are you able to upgrade to a newer version of the SDK?