-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to MQTT broker: MqttCommunicationException #21
Comments
@MattHoneycutt I have similar issue. my broker is talking over ssl. On server side (broker side) I used self-signed cert signed by self-signed CA. On client side, I install the CA cert in the trusted authority. However, I always get the generic uPLibrary.Networking.M2Mqtt.Exceptions.MqttCommunicationException.
The code to create the client is as below: X509Certificate2 caCert = new X509Certificate2(Directory.GetCurrentDirectory() + "/Certs/Development/RootCA.crt");
MqttClient client = new MqttClient(brokerHostName, 443, true, caCert, null, MqttSslProtocols.TLSv1_2);
string clientId = Guid.NewGuid().ToString();
client.Connect(clientId, userName, password); By checking the network trace, it seems the SSL channel has been established. However, after some time (few seconds) the connection is failed with communication error. |
I'm having this exact same issue, as well. I'm using Mosquitto 0.15, M2Mqtt 4.3.0 and MQTT.fx 1.5. When connecing with MQTT.fx, I can connect to mosquitto but only with v3.1. If I use v3.1.1 instead, it immediately looses the connection. When connecting to mosquitto via m2mqtt, I get the same error message in the logs as when I try MQTT.fx with v3.1.1. `1527514650: New connection from 127.0.0.1. 1527514650: Invalid protocol "MQTT" in CONNECT from 127.0.0.1. Before the m2mqtt client throws the MqttCommunicationException exception, it pegs the CPU out at 100% What I did to 'fix' this issue was force m2mqtt to use v3.1 with
That seemed to make it work. |
Hello, I'm also having this issue and the fix proposed by amguilmet didn't work. Does anyone have additional suggestions? |
Hello everyone, I am working on Unity for Hololens, and I am facing the same problem whatever the server is active or not. The problem only happens on Hololens and not in my desktop Unity Editor. Thank you. |
Hello everyone var CaCert = X509Certificate.CreateFromCertFile(@"D:\Aws\root-CA.crt");
Error: please help me |
I'm also getting this exception - I'm trying to connect to www.mosquitto.org (without SSL) and get the exception 35 secs after the call to .Connect(). As well as this exception, when I try to close my WPF app, the window disappears by the process remains, and I have to kill it. The debugger shows me that there's a worker thread stuck in Socket.Receive(). |
Hello The server detect a new conection but the client cant connect |
@inforaudio did you find the solution? I am having the same issue |
Hello Everyone, |
seems no one have the solution yet ? |
I'm getting a generic "Exception of type 'uPLibrary.Networking.M2Mqtt.Exceptions.MqttCommunicationException' was thrown." while trying to connect to an MQTT broker. I can connect to the broker just fine using MQTT.fx, and I can connect to another MQTT broker just fine using the M2MQTT libraries, so I'm thinking that the client isn't compatible with this particular broker for some reason.
Is there some way to get additional logging details or a deeper view into what's going wrong?
The text was updated successfully, but these errors were encountered: