From 041fc9adc543976ceb809acd6d61348e7b0b63c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Mon, 13 Mar 2017 23:17:28 +0100 Subject: [PATCH] Support for SSL in AsyncMQTTClient. Not functional yet --- code/espurna/config/general.h | 1 + code/espurna/mqtt.ino | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 5613db52..02f8795e 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -136,6 +136,7 @@ #define MQTT_SERVER "" #define MQTT_PORT 1883 +#define MQTT_SSL 0 #define MQTT_TOPIC "/test/switch/{identifier}" #define MQTT_RETAIN true #define MQTT_QOS 0 diff --git a/code/espurna/mqtt.ino b/code/espurna/mqtt.ino index 5133885a..326cefc3 100644 --- a/code/espurna/mqtt.ino +++ b/code/espurna/mqtt.ino @@ -221,7 +221,11 @@ void mqttConnect() { mqtt.setCredentials(_mqttUser, _mqttPass); } DEBUG_MSG_P(PSTR("\n")); - mqtt.connect(); + #if ASYNC_TCP_SSL_ENABLED + mqtt.connect(getSetting("mqttSSL", MQTT_SSL).toInt() == 1); + #else + mqtt.connect(); + #endif #else