gpt4 book ai didi

azure - 尝试使用 IoT 中心设备预配服务注册设备时出现无效 CN 错误

转载 作者:太空宇宙 更新时间:2023-11-03 14:34:45 25 4
gpt4 key购买 nike

我正在尝试向 Azure IoT DPS 注册假设备。这是我第一次尝试使用DPS。我已为以下内容添加了 X.509 自签名证书,并通过 Azure 使用“拥有证明”技术对其进行了验证。

  1. 物联网中心
  2. DPS 本身

我正在尝试为设备添加叶证书。叶证书使用 DPS 证书作为其 CA。 (下面使用的命令)。我收到错误 -

The CN (common name) in the primary certificate is invalid.

我读到设备注册 ID 必须与 CN 相同。因此,所使用的 CN 需要修改,或者需要有一种方法可以指定与我的 CNAME 相同的注册 ID。

有人可以帮忙解决这些问题吗--

  1. 在 DPS 上哪里可以指定设备注册 ID?添加注册页面没有此字段。设备 ID 在那里,但它是可选字段。如果未输入,设备 ID 将根据文档设置为注册 ID 本身。
  2. 对于叶证书,CN 可以是任何有效的通用名称标识符,还是应该包含更多详细信息,例如根 CA 名称等? (设备注册 ID 必须是字母数字、小写,可能包含连字符)。

用于生成证书的命令:

makecert -r -pe -n "CN=Sam-DPS.azure-devices-provisioning.net" -cy authority -sky signature -sv Sam-DPS.pvk Sam-DPS.cer

makecert -pe -n "CN=hl1234" -cy end -sky signature -ic Sam-DPS.cer -iv Sam-DPS.pvk -sv hl1234.pvk hl1234.cer

最佳答案

  1. Where can device registration id be specified on DPS? Add enrollment page does not have this field. Device id is there, but it is optional field. IF not entered, device id will be set to registration id itself, as per documentation.

您无法在 Azure 门户中指定注册 ID。对于 x509,registration id当您上传叶证书并成功添加个人注册时,会从证书的使用者名称 (CN) 中自动获取。设备 ID 是 IoT 中心中显示的 ID。您可以使用从 IoT 中心创建的设备 ID 或将其留空,然后在注册此设备时将其分配给注册 ID。注册成功后您将在IoT Hub中看到它。

  1. For a leaf certificate, can CN be any valid common name identifier, or it should contain more details like root CA name etc.? (For the device registration id needs to be alphanumeric, lowercase, may contain hyphens).

叶证书的 CN 不需要与根 CA 相关。但是,由于注册id是作为证书的主体名称提供的,所以CN需要遵循注册id的规则:

注册 ID 为小写字母数字,并且可能包含连字符。

我测试“hl1234”作为设备叶证书CN,它是有效的。

enter image description here

您可以查看this用于创建叶证书。

关于azure - 尝试使用 IoT 中心设备预配服务注册设备时出现无效 CN 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49063021/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com