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
asked 3 months ago154 views
2 Answers
0
Accepted Answer

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
EXPERT
Greg_B
answered 3 months ago
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
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions