iot hub java sdk 2.1.3 version uses which TLS version by default

Madanala, Jayashree 151 Reputation points
2023-10-05T10:53:06.85+00:00

I am using Azure iot sdk of version 2.1.3 of java. My iothub minimum version set to TLS 1.0.

Can you please let me know which version of TLS version is used by default when i try to connect to iothub through code.

What is the way/process to know what tls version is used to connect from device to iothub.

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,124 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
208 questions
0 comments No comments
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 13,471 Reputation points
    2023-10-05T20:55:15.3966667+00:00

    Hi @Madanala, Jayashree Greetings! Thank you for posting the question here. I have looked into the source code of the Azure IoT SDK Device Client 2.1.3 version. You can download the source code for this version of the SDK from the Assets section of the above shared link. I have a found reference of SSL_CONTEXT_PROTOCOL="TLSv1.2" being used in the file \azure-iot-sdk-java-2022-12-12\device\iot-device-client\src\main\java\com\microsoft\azure\sdk\iot\device\auth\IotHubSSLContext.java Based on this finding, I would say the device client SDK version 2.1.3 is using TLS version 1.2

    Even though the TLS used in SDK is at a higher version than what is set at the IoT Hub, there should not be any issues with the connectivity.

    What is the way/process to know what tls version is used to connect from device to iothub.

    There is a method defined under the same file with name getSSLContext which will return the SSL context used by the SDK. Please find the line of code from the latest version of the SDK client on the GitHub repository for reference.

    Please note that the default value for this is set to "TLSv1.2". However, the file configure_tls_protocol_version_and_ciphers.md states that the version used by the SDK can be modified by changing the property as follows: $ java -Djdk.tls.client.protocols="TLSv1.2" yourApp. This property was introduced to JDK7 7u95 and to JDK6 6u121.

    Hope this answers your question. Please let us know if you have any follow up questions or need further clarification.


    If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.

    0 comments No comments

0 additional answers

Sort by: Most helpful