An X.509 certificate is a digital certificate that is used to authenticate a communication entity. For devices that use the MQTT protocol, you can configure Link SDK for C and use X.509 certificates to connect the devices with IoT Platform.

Prerequisites

Process

The process of establishing an X.509 certificate-based MQTT connection is the same as the process of establishing an MQTT connection. You only need to additionally specify the certificate information. The application program calls the API operations of Link SDK for C to connect with IoT Platform over MQTT.

The following figure shows the process. In this example, the ./demos/mqtt_x509_auth_demo.c application program is used.

Development process

For more information about MQTT connection-specific API operations, see aiot_mqtt_api.h.

Usage notes

  • X.509 certificates are only applicable to devices that are directly connected to IoT Platform based on the MQTT protocol.
  • X.509 certificates are supported only in the China (Shanghai) region.
  • X.509 certificates are not applicable to products that use LoRaWAN as the network connection mode.
  • After you specify an authentication mode for a device, you cannot modify the mode.

Examples