amenzhinsky / iothub

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

Error 'x509: certificate signed by unknown authority' when using connectionstring #79

Closed zambranohally closed 1 year ago

zambranohally commented 1 year ago

I am using this code.

iotClient, err := iotdevice.NewFromConnectionString(mqtt.New(), connString)
if err != nil {
     fmt.Println(err.Error())
}

I got this error network Error : x509: certificate signed by unknown authority

andersonprante commented 1 year ago

The solution is already in the master branch, but because the last tag of package is v0.9.0, go get retrieves the "old version" (latest tag)

For me, the solution was to run go get github.com/amenzhinsky/iothub@master, an then the problem was resolved.

To verify, open common/tls.go and check if line 20 contains // DigiCert Global Root G2 (sha1 fingerprint=df3c24f9bfd666761b268073fe06d1cc8d4f82a4)

Cheers!

amenzhinsky commented 1 year ago

Created v0.9.1 tag.