mod_s2s: session.from_host does not allways exist on incoming connections, true and...
authorKim Alvefur <zash@zash.se>
Mon, 25 Mar 2013 07:18:49 +0000 (08:18 +0100)
committerKim Alvefur <zash@zash.se>
Mon, 25 Mar 2013 07:18:49 +0000 (08:18 +0100)
plugins/mod_s2s/mod_s2s.lua

index ec969cc31741ccbe43cc2c629046594a523a93ca..dc4d727d42b370916e5bdf5779092d9fe5456e54 100644 (file)
@@ -211,7 +211,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 host = session.direction == "outgoing" and session.to_host or session.from_host
        local conn = session.conn:socket()
        local cert
        if conn.getpeercertificate then