Iot Core: problem to connect my device

0

Hello, I am starting with AWS Iot Core. I use the MQTT protocol.

I did create my Device on the account, as well as its shadow and embedded the 3 certificates: AmazonRootCA1.pem, <MyDeviceName>.cert.pem, and <MyDeviceName>.private.key

When I try to connect, each of these certificates seems to be well recognized by my API functions, (I'm not using the AWS SDK, I'm using the Azure RTOS APIs... provided by my device's microcontroller manufacturer)

However the TLS session seems to start correctly, the "ClientHello" transaction seems to start well with a successful first handshake, but the connection breaks without me being able to find the reason.

Namely, my code was adapted for AWS IOT Core, because it originally worked for Azure IT Hub...

I hope someone here can help me?

Thanks in advance,

Best Regards, Eric F.

已提问 1 年前537 查看次数
3 回答
2
已接受的回答

You need to check whether the policy attached to that certificate allows the device to perform the operation your code is doing on the necessary resources. Assuming you're publishing into a specific topic, the policy needs to allow an iot:Publish action on that topic (or covered by a wildcard).

profile pictureAWS
专家
Tasio
已回答 1 年前
profile pictureAWS
专家
已审核 1 年前
1

Hello Eric,

you should enable logging for IoT Core. Then you might find information about what happens in CloudWatch logs.

You should also validate the IoT policy attached to your device certificate. If the MQTT client violates this policy, for example by sending a not permitted client ID it will be disconnected.

Cheers,
Philipp

AWS
专家
已回答 1 年前
0

Thank you both for your quick answers. I had not actually attached my certificates to the policy I created... Regards, Eric

已回答 1 年前

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

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

回答问题的准则