Managing TLS connections using Lua and Lua coroutines