4

我尝试在 iOS 14 beta 上运行我的应用程序。它在 iOS 13 上运行良好,但无法连接到 iOS 14 beta 上的任何服务器。NEVPNManager.shared().connection.startVPNTunnel() 不会引发任何错误,并且 NEVPNStatus 与我连接的任何服务器变为 .disconnected。我在 iOS 14 上找不到 NEVPNManager 的变化。

这是我的经理的配置:

let p = NEVPNProtocolIKEv2()
p.authenticationMethod = NEVPNIKEAuthenticationMethod.none
p.serverAddress = account.server
p.disconnectOnSleep = false
p.deadPeerDetectionRate = NEVPNIKEv2DeadPeerDetectionRate.medium
p.username = account.account
p.passwordReference = KeychainWrapper.passwordRefForVPNID()
p.disableMOBIKE = false
p.disableRedirect = false
p.enableRevocationCheck = false
p.enablePFS = false
p.useExtendedAuthentication = true
p.useConfigurationAttributeInternalIPSubnet = false
p.remoteIdentifier = account.server
p.localIdentifier = account.account
            
let manager = NEVPNManager.shared()
manager.protocolConfiguration = p
manager.isEnabled = true
let ruleConnect = NEOnDemandRuleConnect()
ruleConnect.probeURL = account.probeUrl
manager.onDemandRules = [ruleConnect]
manager.isOnDemandEnabled = true
4

1 回答 1

0

似乎 Apple 更改了 iOS 14 上的密码(有文档),您可以在此处看到一些线程:

https://developer.apple.com/forums/thread/659209
https://developer.apple.com/forums/thread/657792
https://developer.apple.com/forums/thread/657792
https://developer.apple.com/forums/thread/661298?page=2

如果您像我一样使用 StrongSwan,您可以通过从 VPN 服务器更新配置来修复它,只需设置ike=aes256-sha2_256-modp2048esp=aes256-sha2_256,然后重新启动 StrongSwan,然后它适用于 iOS 14。参考:https ://wiki.strongswan.org/projects /strongswan/wiki/AppleClients

于 2020-11-10T11:19:54.577 回答