How to enable VPN from iOS app? (Private APIs OK)

When an iOS device goes into sleep mode, even a configured VPN is unfortunately disconnected.

For a client who wants an iPad app to use a VPN for security, everything needs to be done through a VPN. The app should sync a lot, but the iOS device can disable the VPN on its own. That's why I just need to run it again every time I need an Internet connection (or keep it up).

Do any of you have anything in mind?

Even when using the Private API, this is normal (the application will be distributed only to the client, and not through the App Store).

Or using any application, such as Cisco AnyConnect , will do the job.

+6
source share
2 answers

Two ideas:

1) You can create a configuration profile with VPN on demand. However, this requires client certificate authentication. I assume that if any application tries to access the domains or hosts defined in the VPN section on demand in sleep mode, the VPN will be turned on.

Update . At some point, Apple was brought to justice by VPN on demand, so I believe that they abandoned this feature even after they brought it back. It is a good idea to read this article for iOS 7: http://support.apple.com/kb/ts4550

2) The idea I suggested for this question ( iOS6, switch WiFi to non-jailbroken device ). Here is a copy of the text from there:

I think it makes sense to look at SystemConfiguration.framework.

It has a set of APIs for working with various connection interfaces that are defined here: http://developer.apple.com/library/mac/#documentation/Networking/Reference/SCNetworkConfiguration/Reference/reference.html

This is a private API.

Update . I believe that some changes have occurred in SystemConfiguration, and Apple has simplified security in this structure.

3) Apple may grant some applications additional rights, so they can create functionality that no other application can create. As an example, clients of VPN clients (such as Cisco) have received special rights to create what iOS calls β€œVPN plugins,” which are essentially VPN clients.

+6
source

Now it can be used with the NetworkExtension infrastructure available in iOS 8 and above. If you go to project settings β†’ features, you will find a β€œpersonal VPN”. By enabling it, you will add the framework to your project. There is almost no official documentation, but you can watch the WWDC video here https://developer.apple.com/videos/wwdc/2015/?id=717

0
source

All Articles