Merge 0.9->0.10
authorMatthew Wild <mwild1@gmail.com>
Sun, 12 Jan 2014 11:19:37 +0000 (06:19 -0500)
committerMatthew Wild <mwild1@gmail.com>
Sun, 12 Jan 2014 11:19:37 +0000 (06:19 -0500)
1  2 
plugins/mod_s2s/mod_s2s.lua

index 5afb958c4462e0270c73041bbdafe5f794f75011,aa517bbd73c06f9e4ee3dfa8b3bd5c0909670c44..5531ca3e1b4b90f4c71e70ffe16588b3314048e4
@@@ -366,9 -356,9 +366,9 @@@ function stream_callbacks.streamopened(
                        if to then
                                hosts[to].events.fire_event("s2s-stream-features", { origin = session, features = features });
                        else
-                               (session.log or log)("warn", "No 'to' on stream header from %s means we can't offer any features", from or "unknown host");
+                               (session.log or log)("warn", "No 'to' on stream header from %s means we can't offer any features", from or session.ip or "unknown host");
                        end
 -                      
 +
                        log("debug", "Sending stream features: %s", tostring(features));
                        send(features);
                end
@@@ -658,9 -641,9 +658,9 @@@ function check_auth_policy(event
        elseif must_secure and insecure_domains[host] then
                must_secure = false;
        end
 -      
 +
        if must_secure and (session.cert_chain_status ~= "valid" or session.cert_identity_status ~= "valid") then
-               module:log("warn", "Forbidding insecure connection to/from %s", host);
+               module:log("warn", "Forbidding insecure connection to/from %s", host or session.ip or "(unknown host)");
                if session.direction == "incoming" then
                        session:close({ condition = "not-authorized", text = "Your server's certificate is invalid, expired, or not trusted by "..session.to_host });
                else -- Close outgoing connections without warning