core/s2smanager.lua
changeset 2801 0323bdb1fcfa
parent 2800 5880c621f082
child 2813 46dfcc33ea9e
equal deleted inserted replaced
2800:5880c621f082 2801:0323bdb1fcfa
   449 end
   449 end
   450 
   450 
   451 function make_authenticated(session, host)
   451 function make_authenticated(session, host)
   452 	if not session.secure then
   452 	if not session.secure then
   453 		local local_host = session.direction == "incoming" and session.to_host or session.from_host;
   453 		local local_host = session.direction == "incoming" and session.to_host or session.from_host;
   454 		if config.get(local_host, "core", "s2s_require_encryption")) then
   454 		if config.get(local_host, "core", "s2s_require_encryption") then
   455 			session:close({
   455 			session:close({
   456 				condition = "policy-violation",
   456 				condition = "policy-violation",
   457 				text = "Encrypted server-to-server communication is required but was not "
   457 				text = "Encrypted server-to-server communication is required but was not "
   458 				       ..((session.direction == "outgoing" and "offered") or "used")
   458 				       ..((session.direction == "outgoing" and "offered") or "used")
   459 			});
   459 			});