Override hostname with profile value
Now that TunnelKit uses sessionConfiguration.hostname to set .serverAddress, it must be set no matter what. If hostname is nil, serverAddress is set to resolvedAddresses.first, which for host profiles is always nil. Also reorder provider code.
This commit is contained in:
parent
c8b9ad0cae
commit
12597d34b3
|
@ -66,6 +66,9 @@ public class HostConnectionProfile: ConnectionProfile, Codable, Equatable {
|
|||
builder.debugLogFormat = configuration.debugLogFormat
|
||||
builder.masksPrivateData = configuration.masksPrivateData
|
||||
|
||||
// forcibly override hostname with profile hostname (never nil)
|
||||
builder.sessionConfiguration.hostname = hostname
|
||||
|
||||
return builder.build()
|
||||
}
|
||||
|
||||
|
|
|
@ -121,11 +121,12 @@ public class ProviderConnectionProfile: ConnectionProfile, Codable, Equatable {
|
|||
builder.debugLogFormat = configuration.debugLogFormat
|
||||
builder.masksPrivateData = configuration.masksPrivateData
|
||||
|
||||
if builder.sessionConfiguration.hostname == nil {
|
||||
builder.resolvedAddresses = pool.addresses()
|
||||
} else if let address = manualAddress {
|
||||
if let address = manualAddress {
|
||||
builder.prefersResolvedAddresses = true
|
||||
builder.resolvedAddresses = [address]
|
||||
} else if builder.sessionConfiguration.hostname == nil {
|
||||
builder.prefersResolvedAddresses = true
|
||||
builder.resolvedAddresses = pool.addresses()
|
||||
} else {
|
||||
builder.prefersResolvedAddresses = !preferences.resolvesHostname
|
||||
builder.resolvedAddresses = pool.addresses()
|
||||
|
|
Loading…
Reference in New Issue