We are developing a macOS VPN application using NEPacketTunnelProvider with a custom encryption protocol.
We are using standard On-Demand VPN rules with Wi-Fi SSID matching but we want to add some additional feature to the native behaviour.
We want to control the 'conenect/disconnect' button status and allow the user to interact with the tunnel even when the on demand rule conditions are satisfied, is there a native way to do it?
In case we need to implement our custom on-demand behaviour we need to access to this information:
- connected interface type
- ssid name
and being informed when it changes so to trigger our logic, how to do it from the app side?
we try to use CWWiFiClient along with ssidDidChangeForWiFiInterface monitoring, it returns just the interface name en0 and not the wifi ssid name.
Is location access mandatory to access wifi SSID on macOS even if we have a NEPacketTunnelProvider?
Please note that we bundle our Network Extension as an App Extension (not SystemExtension).
We’ve already tested this on macOS
OK.
If you’d like to see this change — that is, for macOS to have the same “active VPN configurations” affordance that iOS has — I recommend that you file an enhancement request for that. Please post your bug number, just for the record.
is there a supported API, entitlement, or configuration path
No.
The Core WLAN policy is gated by a linked-on-or-later check, which provides compatibility for existing products while enforcing the privacy rules for new products. And while it’s easy to lie about the SDK you’re built with — if you’re curious, see the vtool man page — we don’t support that because:
- The SDK you’re built with controls a wide range of interesting functionality, and it’s not hard to imagine scenarios where lying about that could cause your product to fail in unexpected ways.
- The path forward here is clear: We don’t want Mac apps getting the user’s SSID without the user understanding that it could be used to track their location. If you try to get around that, you’ll eventually run into problems.
I actually saw this happen as we rolled out this privacy policy:
- It was first enabled in Core WLAN.
- Developers tried to bypass by running the
airporttool. - And in the next major OS release we blocked that path as well.
Note All of this played out here on the forums. I don’t have time today to look up the threads, but if you’re curious you should search for threads with the Core WLAN tag created since we started seeding macOS 14 (so since June 2023).
So, you want to get on a supported path, and I think the best option in your case is to file an ER for the “active VPN configurations” affordance.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"