0

我的 vpn 首选项配置如下:

let newIPSec = NEVPNProtocolIPSec()
newIPSec.serverAddress = AppConfiguration.getVPNEndPoint()
newIPSec.authenticationMethod = NEVPNIKEAuthenticationMethod.sharedSecret
newIPSec.username = VPNCredentialsModel.instance.vpnUserName()
newIPSec.passwordReference = VPNCredentialsModel.instance.vpnPasswordReference() as Data?
newIPSec.sharedSecretReference = VPNCredentialsModel.instance.vpnPresharedKeyReference() as Data?
newIPSec.useExtendedAuthentication = true
self.manager.protocolConfiguration = newIPSec
let disconnectRule = NEOnDemandRuleDisconnect()
disconnectRule.probeURL = URL(string:VPNCredentialsModel.instance.vpnProbeURL()!)
self.manager.onDemandRules = [disconnectRule]
self.manager.isOnDemandEnabled = true
self.manager.isEnabled = true

连接确实会通过,但是当设备进入睡眠或空闲模式以及 VPN 关闭时。当设备启动到 Internet 的连接时,预期的行为是启动 VPN 连接。但这似乎并没有发生。我知道 VPN 在 iOS 9 中被破坏了,我希望在 iOS 10 中解决了这个问题。还有其他人看到这个问题吗?

4

0 回答 0