IOS cannot set VPN programmatically

喜夏-厌秋 提交于 2019-11-28 01:57:49

问题



Kindly asking for help - I've tried to implements things, described in this great post; also I've read tons of different info on internet - but I still can't create VPN and make it work.
I've tried also to download ready .mobileconfig files - they are installed ok, but I'm not able to manage them from my app.
If possible - can you share working code? Certainly, without your credentials - I'll replace them with my one's.

What do I need - simple app, that allows to install/edit and enable/disable VPN connection (at this moment at least pptp and l2tp).
Great thanks in advance.


回答1:


  1. As far as I know, in iOS you can only set programmatically VPN connection with only IPSec and IKEv2 protocols
  2. For me it was very helpful to find this great example of such application https://github.com/lexrus/VPNOn where you can find the examples of both available types of connections to VPN. I think critical point in creating of VPN connection is to provide valid keychain references to your credentials:

p.passwordReference = [VPN user password from keychain];

p.sharedSecretReference = [VPN server shared secret from keychain];



来源:https://stackoverflow.com/questions/29018868/ios-cannot-set-vpn-programmatically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!