Connecting to cluster on HiveMQ cloud using Paho C client


I am unable to connect to HiveMQ cluster using Paho C client

I tried using the following URL




…with appropriate username and password

but the client is not able to connect to the broker.

Return code is -1 which means “A generic error code indicating the failure of an MQTT client operation.” according to the following link.

Please advice.



Hello Harsha,

Thanks for reaching out. I did quick test to connect the HiveMQ cloud cluster Using MQTT CLI. I have followed steps mentioned at Quick Start Guide.

If it is feasible, please do a quick test if you can connect the HiveMQ Cloud with MQTT CLI. You may need to contact Paho mailing list to get this issue resolved if you can connect broker using MQTT CLI.

Kind Regards,

1 Like