From 425f3c87d0bb16097e743927d4d463c99db74fbf Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Tue, 2 Jul 2019 12:27:10 +0300 Subject: [PATCH] + /status: "dns_addresses": add "tls://" or "https://" prefix --- home/control.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/home/control.go b/home/control.go index 6aa85ccf..9e06258a 100644 --- a/home/control.go +++ b/home/control.go @@ -109,6 +109,23 @@ func getDNSAddresses() []string { addDNSAddress(&dnsAddresses, config.DNS.BindHost) } + if config.TLS.Enabled && len(config.TLS.ServerName) != 0 { + + if config.TLS.PortHTTPS != 0 { + addr := config.TLS.ServerName + if config.TLS.PortHTTPS != 443 { + addr = fmt.Sprintf("%s:%d", addr, config.TLS.PortHTTPS) + } + addr = fmt.Sprintf("https://%s/dns-query", addr) + dnsAddresses = append(dnsAddresses, addr) + } + + if config.TLS.PortDNSOverTLS != 0 { + addr := fmt.Sprintf("tls://%s:%d", config.TLS.ServerName, config.TLS.PortDNSOverTLS) + dnsAddresses = append(dnsAddresses, addr) + } + } + return dnsAddresses }