Left here for archival purposes.

User avatar
By jvannor
#44241 Hi everyone,

Has something changed recently that broke SSL support in MQTT? I created a new build using the build service yesterday, including SSL support - I wanted to add the CJSON module to my firmware. Anyway, after doing that, my application can't connect using a secure MQTT connection. I get a "ssl not available" error, even though I see evidence that SSL is enabled in the start up message.

Thanks!

Start up:
================================================================================
NodeMCU custom build by frightanic.com
branch: dev
commit: 117df40f5856635968e2acf48e8f9af9b6e1ce36
SSL: true <-- SSL IS TRUE!!
modules: adc,cjson,crypto,file,gpio,mqtt,net,node,rtctime,sntp,tmr,uart,wifi
build built on: 2016-03-28 14:23
powered by Lua 5.1.4 on SDK 1.5.1(e67da894)

================================================================================

Test Program:
================================================================================
MQTT_CLIENT = nil

function mqttConnected(client)
print("mqttConnected(client)")
end

function mqttFailed(client, reason)
print("mqttFailed(client, reason)")
end

function mqttDisconnected(client)
print("mqttDisconnected(client)")
end

function hubAddressReady(sk, ip)
print("hubAddressReady(sk, ip)")
if (ip ~= nil) then
local a = "[STRING-03]"
local b = "[STRING-02]"
local c = "[STRING-03]"

MQTT_CLIENT = mqtt.Client(a, 120, b, c, 1)
MQTT_CLIENT:on("offline", mqttDisconnected)
MQTT_CLIENT:connect(ip, 8883, 1, 1, mqttConnected, mqttFailed)
end
end

function networkOnline()
print("networkOnline()")
net.dns.resolve("[STRING-04]", hubAddressReady)
end

wifi.setmode(wifi.STATION)
wifi.sta.eventMonReg(wifi.STA_GOTIP, networkOnline)
wifi.sta.eventMonStart()
wifi.sta.config("[STRING-05]", "[STRING-06]", 1)
================================================================================

Output:
================================================================================
networkOnline()
hubAddressReady(sk, ip)
PANIC: unprotected error in call to Lua API (Program.lua:30: ssl not available)

================================================================================