mod_tls: Fixed traceback during S2S TLS (nil global access).
[prosody.git] / plugins / mod_tls.lua
index 8f688d613154d1ed77afcdb65bbe1af432c77d28..67d8d5d771984bd1df4dd485b124f6fb3c7e4258 100644 (file)
@@ -28,7 +28,7 @@ local function can_do_tls(session)
        if session.type == "c2s_unauthed" then
                return session.username and session.conn.starttls and host.ssl_ctx_in;
        elseif session.type == "s2sin_unauthed" then
-               return origin.to_host and origin.conn.starttls and host.ssl_ctx_in;
+               return session.to_host and session.conn.starttls and host.ssl_ctx_in;
        end
        return false;
 end