Certificate issue with ESP32 using MQTTClient

0

Hello,

I have an issue connecting to my IoT Endpoint in IoT Core. I'm using the example from https://github.com/aws-samples/aws-iot-esp32-arduino-examples/tree/master/examples/basic-pubsub I've registered my ESP32 as a thing, created a policy (with wildcards *), and attached the certificates to the policy. I also tried attaching the certificates to the thing. I changed the code in the example to match the name of my thing, and I provided the certificates and the private key in secrets.h Now my ESP32 cannot connect, and I get the error -3, which translates to "LWMQTT_NETWORK_FAILED_CONNECT"

As Root CA, I'm using AmazonRootCA1, I also re-created the certificates. When I took a trace , I saw that during the TLS negotiating phase, my ESP32 answers with an "Unknown CA" alter and closed the connection. Enter image description here

This is keeping me busy already for a few days. Any idea on how I can debug (or fix) this?

Kr, Wim

WimDH
gefragt vor 3 Monaten173 Aufrufe
2 Antworten
0
Akzeptierte Antwort

Hi. Are you trying to connect to the ATS endpoint (you should be)?

https://docs.aws.amazon.com/iot/latest/developerguide/server-authentication.html#endpoint-types

profile pictureAWS
EXPERTE
Greg_B
beantwortet vor 3 Monaten
0

Hello Greg,

Thanks for pointing me in the right direction. Indeed, I was pointing to a fault endpoint: <some-random-chars>.iot.your-region.amazonaws.com, while it should have been: <some-random-chars>-ats.iot.your-region.amazonaws.com

I found it out when I issued the command aws iot describe-endpoint --endpoint-type iot:Data-ATS

Thanks for the swift reply!

Wim

WimDH
beantwortet vor 3 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen