azure - 出现 CreateServerCertificateAsync 错误:在 IoT Edge 设备上使用测试证书时无法获取服务器证书(天蓝色)
问题描述
我正在尝试在 IoT Edge 设备端启用证书我正在使用演示证书,但 iothub 模块失败并出现以下错误
2021-04-27 02:08:48.364 +00:00 Edge Hub Main()
Unhandled exception. System.AggregateException: One or more errors occurred. (Error calling CreateServerCertificateAsync: Could not get server cert
caused by: internal error)
---> Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadCommunicationException- Message:Error calling CreateServerCertificateAsync: Could not get server cert
caused by: internal error, StatusCode:500, at: at Microsoft.Azure.Devices.Edge.Util.Edged.Version_2019_01_30.WorkloadClient.HandleException(Exception ex, String operation) in /home/vsts/work/1/s/edge-util/src/Microsoft.Azure.Devices.Edge.Util/edged/version_2019_01_30/WorkloadClient.cs:line 109
at Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadClientVersioned.Execute[T](Func`1 func, String operation) in /home/vsts/work/1/s/edge-util/src/Microsoft.Azure.Devices.Edge.Util/edged/WorkloadClientVersioned.cs:line 77
at Microsoft.Azure.Devices.Edge.Util.Edged.Version_2019_01_30.WorkloadClient.CreateServerCertificateAsync(String hostname, DateTime expiration) in /home/vsts/work/1/s/edge-util/src/Microsoft.Azure.Devices.Edge.Util/edged/version_2019_01_30/WorkloadClient.cs:line 35
at Microsoft.Azure.Devices.Edge.Util.CertificateHelper.GetServerCertificatesFromEdgelet(Uri workloadUri, String workloadApiVersion, String workloadClientApiVersion, String moduleId, String moduleGenerationId, String edgeHubHostname, DateTime expiration) in /home/vsts/work/1/s/edge-util/src/Microsoft.Azure.Devices.Edge.Util/CertificateHelper.cs:line 260
at Microsoft.Azure.Devices.Edge.Hub.Service.EdgeHubCertificates.LoadAsync(IConfigurationRoot configuration, ILogger logger) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/EdgeHubCertificates.cs:line 54
at Microsoft.Azure.Devices.Edge.Hub.Service.Program.MainAsync(IConfigurationRoot configuration) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Program.cs:line 54
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Microsoft.Azure.Devices.Edge.Hub.Service.Program.Main() in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Program.cs:line 33
请在 /etc/aziot/config.toml 文件中找到配置
trust_bundle_cert = "file:///home/azureuser/cert/certs/azure-iot-test-only.root.ca.cert.pem"
[edge_ca]
cert = "file:///home/azureuser/cert/certs/iot-edge-device-ca-test-device-ca-certs-full-chain.cert.pem"
pk = "file:///home/azureuser/cert/certs/iot-edge-device-ca-test-device-ca-certs.cert.pem"
[provisioning]
source = "manual"
connection_string ="HostName=XXXXXXXXX-dev.azure-devices.net;DeviceId=test-device;SharedAccessKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
解决方案
我在提到根 ca 的路径时犯了一个错误。问题已解决
推荐阅读
- react-native - 如何在 flatlist react-native 中呈现按钮?
- c# - 从列表与对象绑定
- spring - 如何配置 Spring Boot 应用程序在 Eclipse STS 中运行
- java - 如何在 node-red 中导入自定义 jar
- sql - 在表之间“同步”或复制
- webstorm - 使用 webstorm 调试一个 react native / expo 应用程序
- regex - 正则表达式中对 unicode 的更正
- google-workspace - 将 Android Management API 与标准 GSuite EMM 提供程序一起使用(Google 移动管理)
- javascript - 如何在 iOS 设备 (Safari) 中去抖动或限制滚动事件
- android - 如何更改按钮中的图标颜色?