Software /
code /
prosody
Comparison
plugins/mod_s2s/mod_s2s.lua @ 5387:1130887e0d41
mod_s2s: session.from_host does not allways exist on incoming connections, true and nil or "our hostname" does not evaluate to what we want here
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 25 Mar 2013 08:18:49 +0100 |
parent | 5368:ab31dbb3a415 |
child | 5389:d147a4227a72 |
comparison
equal
deleted
inserted
replaced
5386:43059357b2f0 | 5387:1130887e0d41 |
---|---|
209 return true; | 209 return true; |
210 end | 210 end |
211 | 211 |
212 --- Helper to check that a session peer's certificate is valid | 212 --- Helper to check that a session peer's certificate is valid |
213 local function check_cert_status(session) | 213 local function check_cert_status(session) |
214 local host = session.direction == "incoming" and session.from_host or session.to_host | 214 local host = session.direction == "outgoing" and session.to_host or session.from_host |
215 local conn = session.conn:socket() | 215 local conn = session.conn:socket() |
216 local cert | 216 local cert |
217 if conn.getpeercertificate then | 217 if conn.getpeercertificate then |
218 cert = conn:getpeercertificate() | 218 cert = conn:getpeercertificate() |
219 end | 219 end |