# HG changeset patch # User Kim Alvefur # Date 1363034355 -3600 # Node ID d45316798b71f9fe2efbba32cbe78a41eb44cb46 # Parent e76c22199efa7ff062f26808d63b572ff2db5e0a mod_s2s: Make sure host variable is reachable diff -r e76c22199efa -r d45316798b71 plugins/mod_s2s/mod_s2s.lua --- a/plugins/mod_s2s/mod_s2s.lua Sun Mar 10 17:49:07 2013 +0000 +++ b/plugins/mod_s2s/mod_s2s.lua Mon Mar 11 21:39:15 2013 +0100 @@ -136,6 +136,7 @@ --- 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 @@ (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