device connectivity issue when using TLS

somayeh mahmoodi 0 Reputation points
2024-10-31T15:18:12.33+00:00

I try to send mqtt messages to my Azure IoT hub using port 8883 and TLSv1.2. I uploaded CA certficate (Digicert Global Root G2) in my device, and use SAS authentication for device (client authentication). My hub's monitoring section shows there are "used messages", but not "sent telemetry messages", or even "failed telemetry messages". It seems my device is not connecting to IoT hub properly. I wonder why.

When I use Azure-cli I can see my messages in my hub using Azure iot explorer. I am also able to send mqtt messages with TLsv1.2 from node-red in my laptop to the Azure iot hub.

I connected to the iot hub one months ago, but do not remember the setting at that time, and now I am stuck. I think I did things without sever certificates. Is there any special consideration when uploading the certificate to my device? (like encoding or anything else) I just imported .pem or .cer file I downloaded from Digicert website. Do I need to upload the certificate in Azure somewhere or declare I am using it?

I would appreciate it if anyone help me to solve the issue.

Is there any technical support service for azure customers?

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,213 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 33,396 Reputation points MVP
    2024-10-31T22:00:05.1966667+00:00

    Hello @somayeh mahmoodi,

    welcome to this moderated Azure community forum.

    Take a look at this example based on the Nanoframework.

    As you can see in the source code, both the client cert and client key are used, next to the public key.

    Notice that I used the G3 certificate because of the test I did with the IoT hub endpoint.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.