mod_s2s: Guard against LuaSec not returning TLS info here too

See previous commit to mod_c2s: a62146353528
This commit is contained in:
Kim Alvefur 2021-06-21 13:43:40 +02:00
parent 814a3a3482
commit d07638c8d2

View file

@ -385,7 +385,8 @@ function stream_callbacks._streamopened(session, attr)
session.encrypted = true;
local sock = session.conn:socket();
if sock.info then
local info = sock.info and sock:info();
if type(info) == "table" then
local info = sock:info();
(session.log or log)("info", "Stream encrypted (%s with %s)", info.protocol, info.cipher);
session.compressed = info.compression;