I am currently trying to connect to my free cloud hivemq cluster using M2Mqtt Unity. However, I keep getting a connection exception. The cluster url, port, username, and password are correct. I tried using MQTTnet in another script and it worked.
I would like to know if there are any restrictions when it comes to M2Mqtt Unity? And how can I resolve this? Thank you!
While at this time we do not have known restrictions for M2MQTT Unity, there are some requirements when attempting a connection to a HiveMQ Cloud broker. Namely, the connecting client must support TLS, and TLS-SNI.
Additionally, some connecting clients require the provisioning of a server certificate file. This can be obtained directly through this link, or via our frequently asked questions page here.
If this does not resolve the issue you are encountering during connection, please feel free to provide the specific error you are receiving when attempting connection, or other supporting logs that may help us identify the reason for the connection failure.
Thank you for reaching out. To obtain the root certificate, you can download it here. However, it’s important to note that as a root CA certificate, there is no private key available.
In order to better assist you with the Unity-related issue, could you please provide the .cs file for your Unity project and share the instructions you followed for the PFX? This additional information will help us gain a clearer understanding of the challenges you are facing.
Thank you for your cooperation, and we look forward to resolving this matter for you.
It seems you are following the wrong path here, you don’t need to create the certificate to connect to HiveMQ Cloud, you need to obtain the root certificate that can be downloaded here and use it in your code.