【问题标题】:NEVPNManager stop working with iOS 14 betaNEVPNManager 停止使用 iOS 14 beta
【发布时间】:2020-08-06 15:57:09
【问题描述】:

我尝试在 iOS 14 测试版上运行我的应用。它在 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

【问题讨论】:

  • 因为你的服务器,你的服务器兼容IPv6。
  • 我也有类似的问题。如果我手动创建 vpn 配置文件,它连接得很好。但是当我从代码连接时,它会立即断开连接
  • 你找到解决办法了吗?

标签: ios swift networkextension nevpnmanager


【解决方案1】:

似乎 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。参考:@987654321 @

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-01-27
    • 2022-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多