Fix DNS servers not serialized to AppExtension

This commit is contained in:
Davide De Rosa 2019-03-03 10:51:36 +01:00
parent fc22385421
commit 1c1547fc8f
1 changed files with 9 additions and 0 deletions

View File

@ -188,6 +188,7 @@ extension TunnelKitProvider {
sessionConfigurationBuilder.keepAliveInterval = providerConfiguration[S.keepAlive] as? TimeInterval
sessionConfigurationBuilder.renegotiatesAfter = providerConfiguration[S.renegotiatesAfter] as? TimeInterval
sessionConfigurationBuilder.usesPIAPatches = providerConfiguration[S.usesPIAPatches] as? Bool ?? false
sessionConfigurationBuilder.dnsServers = providerConfiguration[S.dnsServers] as? [String]
sessionConfiguration = sessionConfigurationBuilder.build()
shouldDebug = providerConfiguration[S.debug] as? Bool ?? false
@ -255,6 +256,8 @@ extension TunnelKitProvider {
static let usesPIAPatches = "UsesPIAPatches"
static let dnsServers = "DNSServers"
// MARK: Debugging
static let debug = "Debug"
@ -417,6 +420,9 @@ extension TunnelKitProvider {
if let usesPIAPatches = sessionConfiguration.usesPIAPatches {
dict[S.usesPIAPatches] = usesPIAPatches
}
if let dnsServers = sessionConfiguration.dnsServers {
dict[S.dnsServers] = dnsServers
}
if let debugLogFormat = debugLogFormat {
dict[S.debugLogFormat] = debugLogFormat
}
@ -488,6 +494,9 @@ extension TunnelKitProvider {
} else {
log.info("\tTLS wrapping: disabled")
}
if let dnsServers = sessionConfiguration.dnsServers {
log.info("\tCustom DNS servers: \(dnsServers.maskedDescription)")
}
log.info("\tDebug: \(shouldDebug)")
}
}