# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1698914343 -3600
# Node ID b7c08f32112ca74434c6c1016252c59050c82a49
# Parent  7264c4d160724ace3f1ea2dca86b427217c272c1
mod_s2s: Automagically enable DANE for s2sin if 'use_dane' is enabled

Simplifies configuration, only one already existing boolean to flip.

diff -r 7264c4d16072 -r b7c08f32112c plugins/mod_s2s.lua
--- a/plugins/mod_s2s.lua	Wed Nov 01 22:49:56 2023 +0100
+++ b/plugins/mod_s2s.lua	Thu Nov 02 09:39:03 2023 +0100
@@ -95,6 +95,12 @@
 };
 local s2s_service_options_mt = { __index = s2s_service_options }
 
+if module:get_option_boolean("use_dane", false) then
+	-- DANE is supported in net.connect but only for outgoing connections,
+	-- to authenticate incoming connections with DANE we need
+	module:depends("s2s_auth_dane_in");
+end
+
 module:hook("stats-update", function ()
 	measure_connections_inbound:clear()
 	measure_connections_outbound:clear()