# HG changeset patch # User Kim Alvefur # Date 1395154944 -3600 # Node ID 7f68d950bdd64075650c0a4e8160116346278e02 # Parent 93158d5758f377286336749a63159cf61ec00e1e mod_s2s_auth_dane: Fix for a17c2c4043e5 diff -r 93158d5758f3 -r 7f68d950bdd6 mod_s2s_auth_dane/mod_s2s_auth_dane.lua --- a/mod_s2s_auth_dane/mod_s2s_auth_dane.lua Tue Mar 18 15:54:08 2014 +0100 +++ b/mod_s2s_auth_dane/mod_s2s_auth_dane.lua Tue Mar 18 16:02:24 2014 +0100 @@ -75,6 +75,8 @@ end, "_xmpp-server._tcp."..name..".", "SRV"); return true; elseif host_session.direction == "outgoing" then + local srv_hosts = host_session.srv_hosts; + if not (srv_choice and srv_choice.answer and srv_choice.answer.secure) then local srv_choice = host_session.srv_hosts[host_session.srv_choice]; host_session.dane = dns_lookup(function(answer) if answer and (answer.secure and #answer > 0) or answer.bogus then @@ -92,7 +94,7 @@ local _try_connect = s2sout.try_connect; function s2sout.try_connect(host_session, connect_host, connect_port, err) if not host_session.srv_hosts then - host_session.srv_hosts = { target = connect_host, port = connect_port }; + host_session.srv_hosts = { answer = { secure = true }, { target = connect_host, port = connect_port } }; host_session.srv_choice = 1; end if not err and dane_lookup(host_session, _try_connect, host_session, connect_host, connect_port, err) then