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 個月前檢視次數 172 次
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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南