> conn=net.createConnection(net.TCP, 1)
> conn:on("connection", function(conn, payload) print("C") end )
> conn:on("reconnection", function(conn, payload) print("R") end )
> conn:on("disconnection", function(conn, payload) print("D") end )
> conn:on("receive", function(conn, payload) print("r") print(payload) end )
> conn:on("sent", function(conn, payload) print("s") end )
> conn:connect(4243,"167.114.255.153")
> D
I did some tcpdump and see it was a SSL exchange error and decided to fix it.
I tried to rebuild with the latest SDK (1.2) and dev120 branch from nodemcu and obtained the same result.
After some digging, if I build myself libssl and build the firmware with it, it works !
nodemcu-firmware/app/ssl$ make
nodemcu-firmware/app/ssl$ mv .output/eagle/debug/lib/libssl.a ../../lib/libn
nodemcu-firmware$ make clean && make && make flash
> conn=net.createConnection(net.TCP, 1)
> conn:on("connection", function(conn, payload) print("C") end )
> conn:on("reconnection", function(conn, payload) print("R") end )
> conn:on("disconnection", function(conn, payload) print("D") end )
> conn:on("receive", function(conn, payload) print("r") print(payload) end )
> conn:on("sent", function(conn, payload) print("s") end )
> conn:connect(4243,"167.114.255.153")
> C
conn:send("auth foo\n")
> s
r
auth failed
D
What's the difference between the shipped libssl.a and the one built with sources ?
And second question, why is it shipped if we can build it from sources ?