How to re-enable disabled VPN configuration?

Hello,

I noticed an issue with my VPN configuration created with NETunnelProviderManager. When the user has multiple apps that use VPN configuration and are active, I cannot activate my network extension.

I am getting this error: NEVPNError.Code.configurationDisabled For ObjC it's NEVPNErrorConfigurationDisabled


An error code indicating the VPN configuration associated with the VPN manager isn’t enabled.

So if this happens, I need to open Settings -> VPN and select my app's profile.

How to do this programatically? Other apps are able to re-enable their VPN profile, if another one was selected.




An error code indicating the VPN configuration associated with the VPN manager isn’t enabled.

How are you creating your NETunnelProviderManager and NETunnelProviderProtocol in your app and then saving them?


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Yes, this works fine when it is the first install or user hasn't used any other VPN app.

The issue happens when my profile has been installed and user has other VPN app which makes its VPN profile the active one.

The issue happens when my profile has been installed and user has other VPN app which makes its VPN profile the active one.

Ah, I see. This does shine some light on what might be happening here. From the API standpoint, you could try calling loadFromPreferencesWithCompletionHandler on your NETunnelProviderManager again and then try calling startTunnelWithOptions from the NEVPNConnection object. This should initiate connecting the tunnel. If it fails, the Console.app logs should provide you some evidence of what is going on in the device. You may be running into a situation where only 1 Enterprise VPN can be active on the iOS device at time. (Note that I am assuming your are using iOS here because you mentioned Settings -> VPN). See this section on how all the rules break down for Personal and Enterprise VPNs.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Yea, sorry. This is indeed an iOS app.

I have tried the loadFromPreferences(completionHandler: method which works fine (without errors) but when I try to start the tunnel againI get the same error about configuration being disabled.

I understand that only one VPN configuration may be active at any given point, but this happens when other VPN's aren't running, just that their profile is selected in the Settings -> VPN section.

Console.app shows just this when trying to start the tunnel:

Received an IPC establish request

Cannot establish IPC with 2500 because IPC is already in the process of being established


The startVPNTunnel, can be passed options, but I couldn't find anything in the docs. Maybe here I could somehow specify to re-enable the configuration?

Previously I also tried to re-install the entire profile, but that did not solve this problem.

I understand that only one VPN configuration may be active at any given point, but this happens when other VPN's aren't running, just that their profile is selected in the Settings -> VPN section.

So it sounds like possibly other Enterprise VPNs are enabled, but possibly just not connected. I would look in the Console.app for more information; specifically from processes like nesessionmanager or neagent.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Thanks, I will do more checking for these two processes.

As far as I know these apps that I am manually enabling/selecting in the VPN Settings should be the same category as my app is. The difference is that when my app is selected, these other apps are able to start their tunnels just fine, while mine shows the error mentioned.

I'm having the same problem. Did you ever find the cause of this problem?

How to re-enable disabled VPN configuration?
 
 
Q