我使用本指南以编程方式创建VPN:http://ramezanpour.net/post/2014/08/03/configure-and-manage-vpn-connections-programmatically-in-ios-8/
NEVPNProtocolIPSec *p = [[NEVPNProtocolIPSec alloc] init];
p.username = [[alertView textFieldAtIndex:0] text];
p.passwordReference = [keychainItemWrapper objectForKey:(__bridge id)kSecValueData];
p.serverAddress = @"mylink.com";
p.authenticationMethod = NEVPNIKEAuthenticationMethodSharedSecret;
p.sharedSecretReference = [keychainItemWrapper objectForKey:(__bridge id)kSecAttrService];
p.localIdentifier = @"identifier";
p.remoteIdentifier = @"identifier";
p.useExtendedAuthentication = YES;
p.disconnectOnSleep = NO;
[_vpnManager setProtocol:p];在iOS8上一切都很完美。首先,我展示了一个带有textfield的UIAlertView,其中用户输入它的用户名。然后,它将我重定向到我输入共享秘密的设置,然后我就可以连接了。
现在在iOS 9上。在用户名输入并按完后,我得到一个弹出窗口,上面写着:"Application“想要添加VPN配置。当我单击”允许“时,它会保存配置文件。之后,我进入设置,当我按下连接键时,它会说:没有提供VPN共享秘密。(即使我从keychainItemWrapper撤回它,如我的代码所示)。有人能帮我吗?
谢谢
发布于 2016-06-06 12:05:40
p.remoteIdentifier --这是您的组名,因为您使用的是共享秘密。
https://stackoverflow.com/questions/33920107
复制相似问题