I have implemented an esp32 project to connect to a the HiveMQ broker via MQTT. However I constantly receive the message:
mqtt_client: Connection refused, not authorized
mqtt_client: MQTT connect failed
I have set the CA certificate to ISGR Root X1 as it is instrcuted by the HiveMQ Team members in these posts:
Thank you for the detailed follow-up and for performing the TLS-SNI verification. It is great to see that your client supports TLS-SNI.
At this stage, it would be helpful to determine whether the issue is specific to resolving the hostname for your HiveMQ Cloud instance (xxxxxx.s1.eu.hivemq.cloud) or whether it is a more general DNS resolution issue on the device.
As a next step, could you please test the same client against another public MQTT broker, for example:
If your device is able to successfully resolve and connect to test.mosquitto.org but continues to fail with the HiveMQ Cloud hostname, this would indicate that the issue is related to the HiveMQ Cloud endpoint.
However, if the client is unable to resolve test.mosquitto.org as well, then the problem is likely related to your Wi-Fi network’s DNS configuration.
Please let us know the results of this test so we can assist you further.