Our SystemExtensions implements a NetworkExtensions by inheriting from NEPacketTunnelProvider. We override the two methods startWithOptions:completionHandler: and stopTunnelWithReason:completionHandler:.
When starting the connection from the network preferences using the Connect button and then stopping it again using the Disconnect button, the start/stop methods are called as expected.
But when we do the same from our main application using startVPNTunnel() and stopVPNTunnel(), the start method is also called as expected but the stop method is never called, although the connection is actually stopped (it shows disconnected in the network preferences after that call).
What could be the reason for the stop method to never be called? We need to perform clean up in that method and that isn't performed, the connection cannot be started again afterwards, so this is quite a showstopper at the moment.
When starting the connection from the network preferences using the Connect button and then stopping it again using the Disconnect button, the start/stop methods are called as expected.
But when we do the same from our main application using startVPNTunnel() and stopVPNTunnel(), the start method is also called as expected but the stop method is never called, although the connection is actually stopped (it shows disconnected in the network preferences after that call).
What could be the reason for the stop method to never be called? We need to perform clean up in that method and that isn't performed, the connection cannot be started again afterwards, so this is quite a showstopper at the moment.