问题
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:
- As far as I know, in iOS you can only set programmatically VPN connection with only IPSec and IKEv2 protocols
- 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