Unable to connect to Azure IoT hub From Linux machine.

Sayajirao Waydande 0 Reputation points
2023-09-02T17:35:02.0366667+00:00

I am connecting to Azure iot hub using Azure-iot-sdk-c. I am using the API 

IoTHubDeviceClient_CreateFromConnectionString(connectionString, protocol).

My application is working fine from my laptop on which Ubuntu is installed. When I run this application

from the third party device which has Linux installed, I am getting the following error.

 

Error: Time:Fri Sep 1 12:24:31 2023 File: /home/kpit/src/dev/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c

Func:send_handshake_bytes Line:734 error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

Error:Time:Fri Sep 1 12:24:31 2023 File:/home/kpit/src/dev/azure-iot-sdk-c/umqtt/src/mqtt_client.c

Func:onOpenComplete Line:452 Error:failure opening connection to endpoint.

 

 

Here are my questions.

1>Is there any problem in my internet connection?

2>Is there any issue with the Openssl installed on the device which is of version 1.1?

3>Am I making any mistake in connection string?

4>Does it require any certificate?

5>Is there any other issue?

 

Please guide me to resolve this issue.

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,147 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
211 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,609 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 30,711 Reputation points MVP
    2023-09-02T19:43:51.5933333+00:00

    Hello @Sayajirao Waydande,

    based on the exception 'SSL routines:tls_process_server_certificate:certificate verify failed' it seems your device is not capable of accessing the (Digicert (latest)/Baltimore (almost deprecated)) TLS certificate needed to secure the communication with the IoT Hub.

    It probably works on your laptop because that application can access the certificate store on your laptop.

    Please be sure your application also uploads the TLS certificate to your device.

    Check out the SDK samples and quickstarts.


    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.