why system deny add vpn config under OS X

I use this func


@IBAction func addVPN(sender: AnyObject) {
let newManager = NETunnelProviderManager()
newManager.protocolConfiguration = NETunnelProviderProtocol()
newManager.localizedDescription = "Demo VPN"
newManager.protocolConfiguration?.serverAddress = "192.168.2.125:8890"
self.configManager = newManager
self.configManager!.saveToPreferencesWithCompletionHandler { (error) -> Void in
if let saveError = error {
SSLog("Failed to save the configuration: \(saveError)")
return
}
}
}


and system.log show err

ViewController.swift.addVPN[121]:Failed to save the configuration: Error Domain=NEVPNErrorDomain Code=5 "permission denied" UserInfo={NSLocalizedDescription=permission denied}

Does your app have the

com.apple.developer.networking.vpn.api
entitlement? You can figure this out using the instructions in Debugging Entitlement Issues.

IMPORTANT This entitlement is only available to Mac App Store applications.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Is it possible to use the NEVPNManager ( not using PacketTunnelProvider or Proxy stuff ) without going through app store? I can run on my machine and connect etc, but can't distribute to other macs. This is for OS X.

Is it possible to use the NEVPNManager (…) without going through app store?

No. NEVPNManager (for setting up ‘Personal VPN’) is only available to Mac App Store apps.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
why system deny add vpn config under OS X
 
 
Q