MQTT and TLS issue on ESP8266 related to KEEPALIVEs

34 views
Skip to first unread message

John MacLeod

unread,
Jul 9, 2017, 5:23:23 PM7/9/17
to MQTT
I've been using MQTT over TLS on the ESP8266 for a while now but noticed regular disconnects from the broker.  It turns out that they are caused by TLS Secure Alerts being sent by the broker (seen on Wireshark).  The alert turns up in the MQTT data stream on the ESP8266, confusing the code there and the connection ends up broken (either by the broker or the client, I'm not sure who breaks it!).  The Alerts have only ever been seen in response to a KEEPALIVE being sent.  Stop them, and the problem never happens.

Problem happens on different brokers (Bluemix, Local Mosquitto).

Has anyone seen this or resolved it?

John

John MacLeod

unread,
Jul 10, 2017, 12:53:49 AM7/10/17
to MQTT
On closer examination it seems that the TLS Alert may be as a result of some other problem.  The Alert is a Close Notify alert - ie the connection has been closed.

Prior to that happening, junk MQTT data arrives causing the MQTT library to try and read a packet as a result of a junk MQTT header.

I've still never seen this happen unless both TLS is in use & KEEPALIVE packets are being sent.

Paul Fremantle

unread,
Jul 10, 2017, 7:16:21 AM7/10/17
to mq...@googlegroups.com
John

I haven't noticed any problems, but I'm using a different broker for my ESP8266 work (homegrown code built on top of Aedes).

Paul

--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+unsubscribe@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at https://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.



--
Paul Fremantle
Doctoral Researcher, University of Portsmouth, School of Computing
Visiting Scientist, Institute of the Architecture of Application Systems, Stuttgart
Visiting Lecturer, Software Engineering Programme, Oxford University
Co-Founder, WSO2
Apache Member and Committer
twitter: pzfreo / skype: paulfremantle / blog: http://pzf.fremantle.org
Reply all
Reply to author
Forward
0 new messages