From fd9d34b49c2fce869d03102c9491addd570e491e Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 22 Jan 2021 17:58:33 +0100 Subject: [PATCH] Print description of new DNS settings --- .../Protocols/OpenVPN/Configuration.swift | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/TunnelKit/Sources/Protocols/OpenVPN/Configuration.swift b/TunnelKit/Sources/Protocols/OpenVPN/Configuration.swift index 6448981..9727ba6 100644 --- a/TunnelKit/Sources/Protocols/OpenVPN/Configuration.swift +++ b/TunnelKit/Sources/Protocols/OpenVPN/Configuration.swift @@ -613,10 +613,27 @@ extension OpenVPN.Configuration { } else { log.info("\tGateway: not configured") } - if let dnsServers = dnsServers, !dnsServers.isEmpty { - log.info("\tDNS: \(dnsServers.maskedDescription)") - } else { - log.info("\tDNS: not configured") + switch dnsProtocol { + case .https: + if let dnsHTTPSURL = dnsHTTPSURL { + log.info("\tDNS over HTTPS: \(dnsHTTPSURL.maskedDescription)") + } else { + log.info("\tDNS: not configured") + } + + case .tls: + if let dnsTLSServerName = dnsTLSServerName { + log.info("\tDNS over TLS: \(dnsTLSServerName.maskedDescription)") + } else { + log.info("\tDNS: not configured") + } + + default: + if let dnsServers = dnsServers, !dnsServers.isEmpty { + log.info("\tDNS: \(dnsServers.maskedDescription)") + } else { + log.info("\tDNS: not configured") + } } if let searchDomains = searchDomains, !searchDomains.isEmpty { log.info("\tSearch domains: \(searchDomains.maskedDescription)")