Diff

core/sessionmanager.lua @ 1213:de66fa750daf

sessionmanager, mod_tls: Mark a session as secure when TLS is active
author Matthew Wild <mwild1@gmail.com>
date Fri, 29 May 2009 14:28:53 +0100
parent 1076:ba3639692493
child 1222:dd1616a81c49
line wrap: on
line diff
--- a/core/sessionmanager.lua	Thu May 28 20:39:32 2009 +0100
+++ b/core/sessionmanager.lua	Fri May 29 14:28:53 2009 +0100
@@ -171,6 +171,12 @@
 		session:close{ condition = "host-unknown", text = "This server does not serve "..tostring(session.host)};
 		return;
 	end
+	
+	-- If session.secure is *false* (not nil) then it means we /were/ encrypting
+	-- since we now have a new stream header, session is secured
+	if session.secure == false then
+		session.secure = true;
+	end
 						
 	local features = st.stanza("stream:features");
 	fire_event("stream-features", session, features);