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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인