amenzhinsky / iothub

Azure IoT Hub SDK for Golang
MIT License
51 stars 57 forks source link

Fix tls unknown certificate problem. #49

Closed hanofzelbri closed 3 years ago

hanofzelbri commented 3 years ago

We experienced a problem on our iot edge environment where we were not able to connect as an iotedge module to the iothub.

It was an tls error with unknown certificate.

zsombix commented 3 years ago

The exact message states: "x509 certificate signed by unknown authority" It's because the GetBroker() function returns a different value if the device is an edge device. So without this fix all edge devices will not be able to Connect to iothub.