parent
370e68aa3f
commit
e8396ec2cd
|
@ -67,6 +67,7 @@ extension TunnelKitProvider {
|
||||||
keepAliveInterval: nil,
|
keepAliveInterval: nil,
|
||||||
renegotiatesAfter: nil,
|
renegotiatesAfter: nil,
|
||||||
dnsServers: nil,
|
dnsServers: nil,
|
||||||
|
searchDomain: nil,
|
||||||
randomizeEndpoint: false,
|
randomizeEndpoint: false,
|
||||||
usesPIAPatches: nil
|
usesPIAPatches: nil
|
||||||
),
|
),
|
||||||
|
@ -189,10 +190,11 @@ extension TunnelKitProvider {
|
||||||
}
|
}
|
||||||
sessionConfigurationBuilder.keepAliveInterval = providerConfiguration[S.keepAlive] as? TimeInterval ?? ConfigurationBuilder.defaults.sessionConfiguration.keepAliveInterval
|
sessionConfigurationBuilder.keepAliveInterval = providerConfiguration[S.keepAlive] as? TimeInterval ?? ConfigurationBuilder.defaults.sessionConfiguration.keepAliveInterval
|
||||||
sessionConfigurationBuilder.renegotiatesAfter = providerConfiguration[S.renegotiatesAfter] as? TimeInterval ?? ConfigurationBuilder.defaults.sessionConfiguration.renegotiatesAfter
|
sessionConfigurationBuilder.renegotiatesAfter = providerConfiguration[S.renegotiatesAfter] as? TimeInterval ?? ConfigurationBuilder.defaults.sessionConfiguration.renegotiatesAfter
|
||||||
sessionConfigurationBuilder.usesPIAPatches = providerConfiguration[S.usesPIAPatches] as? Bool ?? ConfigurationBuilder.defaults.sessionConfiguration.usesPIAPatches
|
|
||||||
sessionConfigurationBuilder.checksEKU = providerConfiguration[S.checksEKU] as? Bool ?? ConfigurationBuilder.defaults.sessionConfiguration.checksEKU
|
sessionConfigurationBuilder.checksEKU = providerConfiguration[S.checksEKU] as? Bool ?? ConfigurationBuilder.defaults.sessionConfiguration.checksEKU
|
||||||
sessionConfigurationBuilder.dnsServers = providerConfiguration[S.dnsServers] as? [String]
|
sessionConfigurationBuilder.dnsServers = providerConfiguration[S.dnsServers] as? [String]
|
||||||
|
sessionConfigurationBuilder.searchDomain = providerConfiguration[S.searchDomain] as? String
|
||||||
sessionConfigurationBuilder.randomizeEndpoint = providerConfiguration[S.randomizeEndpoint] as? Bool ?? ConfigurationBuilder.defaults.sessionConfiguration.randomizeEndpoint
|
sessionConfigurationBuilder.randomizeEndpoint = providerConfiguration[S.randomizeEndpoint] as? Bool ?? ConfigurationBuilder.defaults.sessionConfiguration.randomizeEndpoint
|
||||||
|
sessionConfigurationBuilder.usesPIAPatches = providerConfiguration[S.usesPIAPatches] as? Bool ?? ConfigurationBuilder.defaults.sessionConfiguration.usesPIAPatches
|
||||||
sessionConfiguration = sessionConfigurationBuilder.build()
|
sessionConfiguration = sessionConfigurationBuilder.build()
|
||||||
|
|
||||||
shouldDebug = providerConfiguration[S.debug] as? Bool ?? ConfigurationBuilder.defaults.shouldDebug
|
shouldDebug = providerConfiguration[S.debug] as? Bool ?? ConfigurationBuilder.defaults.shouldDebug
|
||||||
|
@ -260,14 +262,16 @@ extension TunnelKitProvider {
|
||||||
|
|
||||||
static let renegotiatesAfter = "RenegotiatesAfter"
|
static let renegotiatesAfter = "RenegotiatesAfter"
|
||||||
|
|
||||||
static let usesPIAPatches = "UsesPIAPatches"
|
|
||||||
|
|
||||||
static let checksEKU = "ChecksEKU"
|
static let checksEKU = "ChecksEKU"
|
||||||
|
|
||||||
static let dnsServers = "DNSServers"
|
static let dnsServers = "DNSServers"
|
||||||
|
|
||||||
|
static let searchDomain = "SearchDomain"
|
||||||
|
|
||||||
static let randomizeEndpoint = "RandomizeEndpoint"
|
static let randomizeEndpoint = "RandomizeEndpoint"
|
||||||
|
|
||||||
|
static let usesPIAPatches = "UsesPIAPatches"
|
||||||
|
|
||||||
// MARK: Debugging
|
// MARK: Debugging
|
||||||
|
|
||||||
static let debug = "Debug"
|
static let debug = "Debug"
|
||||||
|
@ -445,18 +449,21 @@ extension TunnelKitProvider {
|
||||||
if let renegotiatesAfterSeconds = sessionConfiguration.renegotiatesAfter {
|
if let renegotiatesAfterSeconds = sessionConfiguration.renegotiatesAfter {
|
||||||
dict[S.renegotiatesAfter] = renegotiatesAfterSeconds
|
dict[S.renegotiatesAfter] = renegotiatesAfterSeconds
|
||||||
}
|
}
|
||||||
if let usesPIAPatches = sessionConfiguration.usesPIAPatches {
|
|
||||||
dict[S.usesPIAPatches] = usesPIAPatches
|
|
||||||
}
|
|
||||||
if let checksEKU = sessionConfiguration.checksEKU {
|
if let checksEKU = sessionConfiguration.checksEKU {
|
||||||
dict[S.checksEKU] = checksEKU
|
dict[S.checksEKU] = checksEKU
|
||||||
}
|
}
|
||||||
if let dnsServers = sessionConfiguration.dnsServers {
|
if let dnsServers = sessionConfiguration.dnsServers {
|
||||||
dict[S.dnsServers] = dnsServers
|
dict[S.dnsServers] = dnsServers
|
||||||
}
|
}
|
||||||
|
if let searchDomain = sessionConfiguration.searchDomain {
|
||||||
|
dict[S.searchDomain] = searchDomain
|
||||||
|
}
|
||||||
if let randomizeEndpoint = sessionConfiguration.randomizeEndpoint {
|
if let randomizeEndpoint = sessionConfiguration.randomizeEndpoint {
|
||||||
dict[S.randomizeEndpoint] = randomizeEndpoint
|
dict[S.randomizeEndpoint] = randomizeEndpoint
|
||||||
}
|
}
|
||||||
|
if let usesPIAPatches = sessionConfiguration.usesPIAPatches {
|
||||||
|
dict[S.usesPIAPatches] = usesPIAPatches
|
||||||
|
}
|
||||||
if let debugLogFormat = debugLogFormat {
|
if let debugLogFormat = debugLogFormat {
|
||||||
dict[S.debugLogFormat] = debugLogFormat
|
dict[S.debugLogFormat] = debugLogFormat
|
||||||
}
|
}
|
||||||
|
@ -539,6 +546,9 @@ extension TunnelKitProvider {
|
||||||
if let dnsServers = sessionConfiguration.dnsServers {
|
if let dnsServers = sessionConfiguration.dnsServers {
|
||||||
log.info("\tCustom DNS servers: \(dnsServers.maskedDescription)")
|
log.info("\tCustom DNS servers: \(dnsServers.maskedDescription)")
|
||||||
}
|
}
|
||||||
|
if let searchDomain = sessionConfiguration.searchDomain {
|
||||||
|
log.info("\tCustom search domain: \(searchDomain.maskedDescription)")
|
||||||
|
}
|
||||||
if sessionConfiguration.randomizeEndpoint ?? false {
|
if sessionConfiguration.randomizeEndpoint ?? false {
|
||||||
log.info("\tRandomize endpoint: true")
|
log.info("\tRandomize endpoint: true")
|
||||||
}
|
}
|
||||||
|
|
|
@ -466,6 +466,7 @@ extension TunnelKitProvider: SessionProxyDelegate {
|
||||||
log.info("\tIPv4: \(reply.options.ipv4?.description ?? "not configured")")
|
log.info("\tIPv4: \(reply.options.ipv4?.description ?? "not configured")")
|
||||||
log.info("\tIPv6: \(reply.options.ipv6?.description ?? "not configured")")
|
log.info("\tIPv6: \(reply.options.ipv6?.description ?? "not configured")")
|
||||||
log.info("\tDNS: \(reply.options.dnsServers.map { $0.maskedDescription })")
|
log.info("\tDNS: \(reply.options.dnsServers.map { $0.maskedDescription })")
|
||||||
|
log.info("\tDomain: \(reply.options.searchDomain?.maskedDescription ?? "not configured")")
|
||||||
|
|
||||||
bringNetworkUp(remoteAddress: remoteAddress, reply: reply) { (error) in
|
bringNetworkUp(remoteAddress: remoteAddress, reply: reply) { (error) in
|
||||||
if let error = error {
|
if let error = error {
|
||||||
|
|
|
@ -115,6 +115,7 @@ public class ConfigurationParser {
|
||||||
sessionBuilder.keepAliveInterval = options.keepAliveSeconds
|
sessionBuilder.keepAliveInterval = options.keepAliveSeconds
|
||||||
sessionBuilder.renegotiatesAfter = options.renegotiateAfterSeconds
|
sessionBuilder.renegotiatesAfter = options.renegotiateAfterSeconds
|
||||||
sessionBuilder.dnsServers = options.dnsServers
|
sessionBuilder.dnsServers = options.dnsServers
|
||||||
|
sessionBuilder.searchDomain = options.searchDomain
|
||||||
sessionBuilder.randomizeEndpoint = options.randomizeEndpoint
|
sessionBuilder.randomizeEndpoint = options.randomizeEndpoint
|
||||||
|
|
||||||
return ParsingResult(
|
return ParsingResult(
|
||||||
|
|
|
@ -171,6 +171,9 @@ extension SessionProxy {
|
||||||
/// - Seealso: `OptionsBundle.dnsServers`
|
/// - Seealso: `OptionsBundle.dnsServers`
|
||||||
public var dnsServers: [String]?
|
public var dnsServers: [String]?
|
||||||
|
|
||||||
|
/// - Seealso: `OptionsBundle.searchDomain`
|
||||||
|
public var searchDomain: String?
|
||||||
|
|
||||||
/// - Seealso: `OptionsBundle.randomizeEndpoint`
|
/// - Seealso: `OptionsBundle.randomizeEndpoint`
|
||||||
public var randomizeEndpoint: Bool?
|
public var randomizeEndpoint: Bool?
|
||||||
|
|
||||||
|
@ -191,6 +194,7 @@ extension SessionProxy {
|
||||||
keepAliveInterval = nil
|
keepAliveInterval = nil
|
||||||
renegotiatesAfter = nil
|
renegotiatesAfter = nil
|
||||||
dnsServers = nil
|
dnsServers = nil
|
||||||
|
searchDomain = nil
|
||||||
randomizeEndpoint = false
|
randomizeEndpoint = false
|
||||||
usesPIAPatches = false
|
usesPIAPatches = false
|
||||||
}
|
}
|
||||||
|
@ -214,6 +218,7 @@ extension SessionProxy {
|
||||||
keepAliveInterval: keepAliveInterval,
|
keepAliveInterval: keepAliveInterval,
|
||||||
renegotiatesAfter: renegotiatesAfter,
|
renegotiatesAfter: renegotiatesAfter,
|
||||||
dnsServers: dnsServers,
|
dnsServers: dnsServers,
|
||||||
|
searchDomain: searchDomain,
|
||||||
randomizeEndpoint: randomizeEndpoint,
|
randomizeEndpoint: randomizeEndpoint,
|
||||||
usesPIAPatches: usesPIAPatches
|
usesPIAPatches: usesPIAPatches
|
||||||
)
|
)
|
||||||
|
@ -259,6 +264,9 @@ extension SessionProxy {
|
||||||
/// - Seealso: `SessionProxy.ConfigurationBuilder.dnsServers`
|
/// - Seealso: `SessionProxy.ConfigurationBuilder.dnsServers`
|
||||||
public let dnsServers: [String]?
|
public let dnsServers: [String]?
|
||||||
|
|
||||||
|
/// - Seealso: `SessionProxy.ConfigurationBuilder.searchDomain`
|
||||||
|
public let searchDomain: String?
|
||||||
|
|
||||||
/// - Seealso: `SessionProxy.ConfigurationBuilder.randomizeEndpoint`
|
/// - Seealso: `SessionProxy.ConfigurationBuilder.randomizeEndpoint`
|
||||||
public let randomizeEndpoint: Bool?
|
public let randomizeEndpoint: Bool?
|
||||||
|
|
||||||
|
@ -283,6 +291,7 @@ extension SessionProxy {
|
||||||
builder.keepAliveInterval = keepAliveInterval
|
builder.keepAliveInterval = keepAliveInterval
|
||||||
builder.renegotiatesAfter = renegotiatesAfter
|
builder.renegotiatesAfter = renegotiatesAfter
|
||||||
builder.dnsServers = dnsServers
|
builder.dnsServers = dnsServers
|
||||||
|
builder.searchDomain = searchDomain
|
||||||
builder.randomizeEndpoint = randomizeEndpoint
|
builder.randomizeEndpoint = randomizeEndpoint
|
||||||
builder.usesPIAPatches = usesPIAPatches
|
builder.usesPIAPatches = usesPIAPatches
|
||||||
return builder
|
return builder
|
||||||
|
@ -304,6 +313,7 @@ extension SessionProxy {
|
||||||
(lhs.keepAliveInterval == rhs.keepAliveInterval) &&
|
(lhs.keepAliveInterval == rhs.keepAliveInterval) &&
|
||||||
(lhs.renegotiatesAfter == rhs.renegotiatesAfter) &&
|
(lhs.renegotiatesAfter == rhs.renegotiatesAfter) &&
|
||||||
(lhs.dnsServers == rhs.dnsServers) &&
|
(lhs.dnsServers == rhs.dnsServers) &&
|
||||||
|
(lhs.searchDomain == rhs.searchDomain) &&
|
||||||
(lhs.randomizeEndpoint == rhs.randomizeEndpoint) &&
|
(lhs.randomizeEndpoint == rhs.randomizeEndpoint) &&
|
||||||
(lhs.usesPIAPatches == rhs.usesPIAPatches)
|
(lhs.usesPIAPatches == rhs.usesPIAPatches)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue