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
已提问 3 个月前173 查看次数
2 回答
0
已接受的回答

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
专家
Greg_B
已回答 3 个月前
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
已回答 3 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则