Skip to content

Problems with encryption enabled #1

Open
@gpvigano

Description

@gpvigano

Environment

M2MqttUnity commit: 2ce51ed
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)

(see also eclipse-paho/paho.mqtt.m2mqtt#21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions