453 end |
453 end |
454 |
454 |
455 function make_authenticated(session, host) |
455 function make_authenticated(session, host) |
456 if not session.secure then |
456 if not session.secure then |
457 local local_host = session.direction == "incoming" and session.to_host or session.from_host; |
457 local local_host = session.direction == "incoming" and session.to_host or session.from_host; |
458 if config.get(local_host, "core", "require_s2s_encryption")) then |
458 if config.get(local_host, "core", "s2s_require_encryption")) then |
459 session:close({ |
459 session:close({ |
460 condition = "policy-violation", |
460 condition = "policy-violation", |
461 text = "Encrypted server-to-server communication is required but was not " |
461 text = "Encrypted server-to-server communication is required but was not " |
462 ..((session.direction == "outgoing" and "offered") or "used") |
462 ..((session.direction == "outgoing" and "offered") or "used") |
463 }); |
463 }); |