X509Certificate2Collection certificates = store.Certificates.Find(X509FindType.FindByThumbprint, "YOUR_CERTIFICATE_THUMBPRINT_HERE", false);
if (certificates.Count == 0)
{
Console.WriteLine("Unable to find the specified certificate.");
return;
}
X509Certificate2 cert = certificates[0];
string certData = Convert.ToBase64String(cert.Export(X509ContentType.Cert));
provisioning:
source: "manual"
device_connection_string: "YOUR_DEVICE_CONNECTION_STRING_HERE"
agent:
name: "edgeAgent"
type: "docker"
env:
- "EdgeHubConnectionString=$(EdgeHubConnectionString)"
- "EdgeModuleCACertificateFile=/path/to/root/ca/certificate.crt"
请根据您证书的实际路径替换 EdgeModuleCACertificateFile
部分。
sudo systemctl restart iotedge
sudo systemctl status iotedge
sudo journalctl -u iotedge -n 100
以上步骤应该可以修复边缘代理无法将X509证书添加到存储中的问题。
上一篇:360安全卫士 漏洞补丁检测模块,守护电脑安全的重要防线
下一篇:AzureIoTHub,pushfromdevicefailseverytimewithconnectionclosed,evenusingmosquitto_pub