cniles/picow-iot

AWS IOT certificates do not work

aaMOUSA opened this issue · 2 comments

Hello,
Testing mosquitto works fine but when I created a AWS IOT thing , and setup the policy and added my certificates, I still have connection error. Don't know if there's a step missing. Attaching below the logs.

image

cniles commented

Beyond thrilled to be closing the loop on this 🥳 Couple things could be causing this for you.

  1. AWS requires SNI extension to be sent by clients. It should be sent (unencrypted) in the TLS handshake request. The code currently awkwardly needs to change mqtt.c so this is set. I have a callback in there currently thats bodged into the mqtt_client_connect call but that is not part of the actual library. Hopefully I can find a better way to handle that if not I'll look into submitting a patch to lwip.

  2. AWS does not support qos level 2. Set that to 0 or 1 and all should be good.

To help troubleshoot you can use the AWS IoT console to check presense messages (is it connecting but client erroring out?).

Good luck!