如何保护IoT设备与Azure IoT-Hub之间的通信?

问题描述 投票:0回答:1

我的设置如下:

在我的本地环境中,我有一台OPC服务器,该服务器从本地OPC设备读取数据并将其发送到我的本地小服务器,然后再将数据发送到Azure上的IoT-Hub(在那里我将数据保存到cosmosDB中)。

与Azure looks like this上的IoT-Hub通信的本地小服务器:

var connectionString = '[IoT Hub device connection string]';
// use factory function from AMQP-specific package
var clientFromConnectionString = require('azure-iot-device-amqp').clientFromConnectionString;

// AMQP-specific factory function returns Client object from core package
var client = clientFromConnectionString(connectionString);

// use Message object from core package
var Message = require('azure-iot-device').Message;

var connectCallback = function (err) {
  if (err) {
    console.error('Could not connect: ' + err);
  } else {
    console.log('Client connected');
    var msg = new Message('some data from my device');
    client.sendEvent(msg, function (err) {
      if (err) {
        console.log(err.toString());
      } else {
        console.log('Message sent');
      };
    });
  };
};


client.open(connectCallback);

我如何确保此通信的安全性?

security azure-iot-hub opc opc-ua
1个回答
0
投票

IoT中心要求通过TLS保护所有连接(请参阅IoT Hub MQTT Support,并且它仅使用安全版本1.2(请参阅IoT Hub TLS deprecating 1.0 and 1.1)。

这将保护您的传输(默认情况下)。

© www.soinside.com 2019 - 2024. All rights reserved.