Skip to content

Commit

Permalink
Fix remoteID.
Browse files Browse the repository at this point in the history
  • Loading branch information
lexrus committed Sep 20, 2016
1 parent eac6336 commit a6656e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VPNOnData/VPNOn.xcdatamodeld/VPN On 5.xcdatamodel/contents
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<attribute name="countryCode" optional="YES" attributeType="String" maxValueString="10" syncable="YES"/>
<attribute name="group" optional="YES" attributeType="String" maxValueString="256" syncable="YES"/>
<attribute name="ikev2" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="NO" syncable="YES"/>
<attribute name="remoteID" optional="YES" syncable="YES"/>
<attribute name="remoteID" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="server" attributeType="String" minValueString="1" maxValueString="256" defaultValueString="vpn" spotlightIndexingEnabled="YES" syncable="YES"/>
<attribute name="title" attributeType="String" minValueString="1" maxValueString="256" defaultValueString="vpn" spotlightIndexingEnabled="YES" syncable="YES"/>
</entity>
Expand Down
4 changes: 3 additions & 1 deletion VPNOnKit/VPNManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a6656e8

Please sign in to comment.