Make usesPIAPatches optional

For compatible decoding.
This commit is contained in:
Davide De Rosa 2018-10-25 08:55:45 +02:00
parent 197d29042c
commit d6e27938bc
2 changed files with 3 additions and 3 deletions

View File

@ -166,7 +166,7 @@ extension SessionProxy {
public var renegotiatesAfter: TimeInterval?
/// Server is patched for the PIA VPN provider.
public var usesPIAPatches: Bool
public var usesPIAPatches: Bool?
/// :nodoc:
public init(ca: CryptoContainer) {
@ -239,6 +239,6 @@ extension SessionProxy {
public let renegotiatesAfter: TimeInterval?
/// - Seealso: `SessionProxy.ConfigurationBuilder.usesPIAPatches`
public let usesPIAPatches: Bool
public let usesPIAPatches: Bool?
}
}

View File

@ -609,7 +609,7 @@ public class SessionProxy {
}
private func hardResetPayload() -> Data? {
guard !configuration.usesPIAPatches else {
guard !(configuration.usesPIAPatches ?? false) else {
let caMD5 = TLSBox.md5(forCertificatePath: caURL.path)
log.debug("CA MD5 is: \(caMD5)")
return try? PIAHardReset(