From a6656e8ee6d7297af7dbf6a875134051acbc465d Mon Sep 17 00:00:00 2001 From: Lex Tang Date: Tue, 20 Sep 2016 23:14:07 +0800 Subject: [PATCH] Fix remoteID. --- VPNOnData/VPNOn.xcdatamodeld/VPN On 5.xcdatamodel/contents | 2 +- VPNOnKit/VPNManager.swift | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VPNOnData/VPNOn.xcdatamodeld/VPN On 5.xcdatamodel/contents b/VPNOnData/VPNOn.xcdatamodeld/VPN On 5.xcdatamodel/contents index d1f7121..4d28042 100644 --- a/VPNOnData/VPNOn.xcdatamodeld/VPN On 5.xcdatamodel/contents +++ b/VPNOnData/VPNOn.xcdatamodeld/VPN On 5.xcdatamodel/contents @@ -6,7 +6,7 @@ - + diff --git a/VPNOnKit/VPNManager.swift b/VPNOnKit/VPNManager.swift index 5c572da..64e4292 100644 --- a/VPNOnKit/VPNManager.swift +++ b/VPNOnKit/VPNManager.swift @@ -27,6 +27,7 @@ public struct VPNAccount { public var server: String = "" public var account: String? public var group: String? + public var remoteID: String? public var alwaysOn = true public var passwordRef: Data? { return KeychainWrapper.passwordRefForVPNID(ID) @@ -89,6 +90,7 @@ open class VPNManager { let p = NEVPNProtocolIPSec() p.useExtendedAuthentication = true p.localIdentifier = account.group ?? "VPN" + p.remoteIdentifier = account.remoteID if let secret = account.secretRef { p.authenticationMethod = .sharedSecret p.sharedSecretReference = secret @@ -100,7 +102,7 @@ open class VPNManager { let p = NEVPNProtocolIKEv2() p.useExtendedAuthentication = true p.localIdentifier = account.group ?? "VPN" - p.remoteIdentifier = account.server + p.remoteIdentifier = account.remoteID if let secret = account.secretRef { p.authenticationMethod = .sharedSecret p.sharedSecretReference = secret