From: Kim Alvefur Date: Mon, 11 Mar 2013 20:39:15 +0000 (+0100) Subject: mod_s2s: Make sure host variable is reachable X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=14b46085cf72301a35aaa02b9e25aef440994928;p=prosody.git mod_s2s: Make sure host variable is reachable --- diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index cabe8ea2..74014457 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -136,6 +136,7 @@ end --- Helper to check that a session peer's certificate is valid local function check_cert_status(session) + local host = session.direction == "incoming" and session.from_host or session.to_host local conn = session.conn:socket() local cert if conn.getpeercertificate then @@ -155,8 +156,6 @@ local function check_cert_status(session) (session.log or log)("debug", "certificate chain validation result: valid"); session.cert_chain_status = "valid"; - local host = session.direction == "incoming" and session.from_host or session.to_host - -- We'll go ahead and verify the asserted identity if the -- connecting server specified one. if host then