Post your best Lua script examples here

User avatar
By gwizz
#7758 Yes, I was wondering about that - there is this line in the wiki example:
-- for secure: m:connect("192.168.11.118", 1880, 1)


Has anyone got any experience with this mode they can share please?

I read that there is a separate port, 8883 for using mqqt over ssl - I assume that is what this refers to?
User avatar
By tuanpm
#7765
gwizz wrote:Yes, I was wondering about that - there is this line in the wiki example:
-- for secure: m:connect("192.168.11.118", 1880, 1)


Has anyone got any experience with this mode they can share please?

I read that there is a separate port, 8883 for using mqqt over ssl - I assume that is what this refers to?


Yes, it already supported SSL
This this repository have information about create SSL Cert & KEY 1024 bit for Mosca and how to run borker with SSL:
https://github.com/tuanpmt/esp_mqtt
Code: Select allopenssl req -x509 -newkey rsa:1024 -keyout key.pem -out cert.pem -days 3650

and you should add NTP module for real-time
User avatar
By Suxsem
#7781
tuanpm wrote:
gwizz wrote:Yes, I was wondering about that - there is this line in the wiki example:
-- for secure: m:connect("192.168.11.118", 1880, 1)


Has anyone got any experience with this mode they can share please?

I read that there is a separate port, 8883 for using mqqt over ssl - I assume that is what this refers to?


Yes, it already supported SSL
This this repository have information about create SSL Cert & KEY 1024 bit for Mosca and how to run borker with SSL:
https://github.com/tuanpmt/esp_mqtt
Code: Select allopenssl req -x509 -newkey rsa:1024 -keyout key.pem -out cert.pem -days 3650

and you should add NTP module for real-time

Great!
But I read that for maximum security I should copy the certificato into the client (esp8266) and not only into the broker...
From: http://test.mosquitto.org/ "Port 8884 requires clients to provide their own certificate to authenticate their connection."
How can I do that with nodemcu?

And...why I need a NTP module? It's time required for encryption?