M2MqttUnity commit: 2ce51edaa2f7f6ea85fb46293c367de5b22faa17
Unity 3D versions: 2017.1.0f3, 2017.1.4f1, 2018.1.9f1, 2018.2.5f1
Steps to reproduce
Open the M2MqttUnity_Test example scene.
Run it in Editor or build on Windows Standalone or Android.
Enable encryption, try to connect to a broker (e.g. iot.eclipse.org).
Expected behavior
Connection successful (activating encryption and choosing the proper port, e.g. 8883 for mosquitto brokers).
Current behavior
While no problem was found using a not encrypted connection,
testing the included example also with encryption
it does not work on Windows Standalone, Android (and even in Unity Editor), but
it works when built on UWP/Windows 10 (PC and HoloLens).
Failed to connect to iot.eclipse.org:8883:
uPLibrary.Networking.M2Mqtt.Exceptions.MqttConnectionException: Exception connecting to the broker ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
at Mono.Security.Protocol.Tls.RecordProtocol.ProcessAlert (AlertLevel alertLevel, AlertDescription alertDesc) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at uPLibrary.Networking.M2Mqtt.MqttClient.Connect (System.String clientId, System.String username, System.String password, Boolean willRetain, Byte willQosLevel, Boolean willFlag, System.String willTopic, System.String willMessage, Boolean cleanSession, UInt16 keepAlivePeriod) [0x00039] in D:\Unity3D\Projects\IoT\M2MqttUnity\Assets\M2Mqtt\MqttClient.cs:565
at uPLibrary.Networking.M2Mqtt.MqttClient.Connect (System.String clientId) [0x0000d] in D:\Unity3D\Projects\IoT\M2MqttUnity\Assets\M2Mqtt\MqttClient.cs:485
at M2MqttUnity.M2MqttUnityClient+<DoConnect>c__Iterator0.MoveNext () [0x001d2] in D:\Unity3D\Projects\IoT\M2MqttUnity\Assets\M2MqttUnity\Scripts\M2MqttUnityClient.cs:304
UnityEngine.Debug:LogErrorFormat(String, Object[])
M2MqttUnity.<DoConnect>c__Iterator0:MoveNext() (at Assets/M2MqttUnity/Scripts/M2MqttUnityClient.cs:309)
Environment
M2MqttUnity commit: 2ce51edaa2f7f6ea85fb46293c367de5b22faa17 Unity 3D versions: 2017.1.0f3, 2017.1.4f1, 2018.1.9f1, 2018.2.5f1
Steps to reproduce
Open the M2MqttUnity_Test example scene. Run it in Editor or build on Windows Standalone or Android. Enable encryption, try to connect to a broker (e.g. iot.eclipse.org).
Expected behavior
Connection successful (activating encryption and choosing the proper port, e.g. 8883 for mosquitto brokers).
Current behavior
While no problem was found using a not encrypted connection, testing the included example also with encryption it does not work on Windows Standalone, Android (and even in Unity Editor), but it works when built on UWP/Windows 10 (PC and HoloLens).
(see also https://github.com/eclipse/paho.mqtt.m2mqtt/issues/21)