I’m trying to connect an H7 Plus to a HiveMQ cloud MQTT broker. The only connection option is via TLS, and the documentation for the MQTT library doesn’t provide much guidance about how to create a TLS connection. Through trial and error (all error thus far), I’m trying this code that I found elsewhere in the forum, but no luck.
KEY_PATH = “uberbroker.pem”
CERT_PATH = “uberbroker.der”
with open(KEY_PATH, ‘r’) as f:
key1 = f.read()
with open(CERT_PATH, ‘r’) as f:
cert1 = f.read()
client = MQTTClient(“openmv”, “01d1669a1147487bb24c993bec906228.s2.eu.hivemq.cloud”, port=8883, ssl=True, user=“<MyUser.”, password=“”,ssl_params={ “key”:key1, “cert”:cert1, “server_side”:False })
client.connect()
I generated a private key using openssl, then generated a PEM file, then a DER file.
At this point I have literally no idea what the issue might be.