Unity에서 AR 응용 프로그램을 빌드 중이며 TLS 프로토콜을 사용하는 MQTT 브로커에 연결해야합니다. TLS가 지원되지 않는 MQTT 브로커에 성공적으로 연결할 수 있으며 (통일성 있음) 관리자가이 프로그램에 부여한 인증서 http://www.mqttfx.org/을 사용하여 TLS 활성화 브로커에 성공적으로 연결할 수 있습니다. 그러나 Unity에서 C# 용 m2mqtt 라이브러리가있는 TLS 지원 서버에 연결하려고하면 시간 초과 예외가 발생하고 브로커에서 응답을받지 못합니다. 이것은 연결을 테스트하는 데 사용하는 코드입니다. 나는 성공적인 연결을 시도한 후 연결을 끊으려고 시도하고 있습니다. MQTT unity3d의 TLS 가능 브로커에 연결할 때 시간 초과
X509Certificate certificate = X509Certificate.CreateFromCertFile("filePath");
// Connect to this broker address at port 1883 with tls enabled
client = new MqttClient(brokerAddress, port, true, certificate);
// Generate a client id
string clientId = Guid.NewGuid().ToString();
// Connect to the client with credentials
byte code = client.Connect(clientId, username, password;
// Disconnect
client.Disconnect();
이 예외
은 연결시 발생MqttCommunicationException: An application exception has occurred.
uPLibrary.Networking.M2Mqtt.MqttClient.SendReceive (System.Byte[] msgBytes, Int32 timeout) (at Assets/MQTT/scripts/MqttClient.cs:953)
uPLibrary.Networking.M2Mqtt.MqttClient.SendReceive (uPLibrary.Networking.M2Mqtt.Messages.MqttMsgBase msg, Int32 timeout) (at Assets/MQTT/scripts/MqttClient.cs:976)
uPLibrary.Networking.M2Mqtt.MqttClient.SendReceive (uPLibrary.Networking.M2Mqtt.Messages.MqttMsgBase msg) (at Assets/MQTT/scripts/MqttClient.cs:964)
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) (at Assets/MQTT/scripts/MqttClient.cs:456)
uPLibrary.Networking.M2Mqtt.MqttClient.Connect (System.String clientId, System.String username, System.String password, Boolean cleanSession, UInt16 keepAlivePeriod) (at Assets/MQTT/scripts/MqttClient.cs:395)
ConnectionManager.connectToMQTTBroker() (at Assets/Scripts/ConnectionManager.cs:55)
어떤 도움을 주시면 감사하겠습니다. 나는 이것을 며칠 동안 붙들고있다.
SSL 인증은 mqtt에서 지원되지 않습니다. – Programmer
무엇을 의미하는지 자세히 설명해 주시겠습니까? 이 인증서를 사용하여 TLS 프로토콜 버전 1.2를 사용하는 MQTT.FX를 사용하여 성공적으로 연결합니다. 그래서 나는 당신이 말하는 것을 혼란스러워합니다. – TacticalBacn
http://www.hivemq.com/blog/mqtt-security-fundamentals-tls-ssl – TacticalBacn