Network Extension

RSS for tag

Customize and extend the core networking features of iOS, iPad OS, and macOS using Network Extension.

Posts under Network Extension tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Failed to see any ICMP data flow from the remote machine within NEFilterDataProvider
Hi Experts, When experimenting with NEFilterDataProvider, I observed that whole ICMP data flows are visible on the local machine when pinging a remote machine from it. However, no ICMP data flows are observed on the local machine when the remote machine pings it. Below is the rule for filtering any protocol with any direction. NEFilterRule(networkRule: .init( remoteNetwork: nil, remotePrefix: 0, localNetwork: nil, localPrefix: 0, protocol: .any, direction: .any), action: .filterData) There is no issue for TCP/UDP. May I know it's a bug or by design?
0
0
245
Feb ’24
Authentication with Certificates
I've implemented a custom VPN for iOS using a Packet Tunnel Provider. I have the entitlement for 'com.apple.managed.vpn.shared'. One option to connect is to use a certificate - this can be done by distributing a VPN payload with the required certificate for the connection. My question is if there's any way to distribute multiple certificates and that I'll be able to read them on my iOS app. For example, on the Certificates payload, I can add multiple certificates, but on the VPN payload, I can choose only one of them. So, can my app read more than one certificate?
2
0
347
Feb ’24
OTA updates for NetworkExtension
Hi, We developing a daemon service that has a network extension We are trying to implement an OTA update mechanism for the entire bundle (which holds 7 packages), and encountering issues with the NetworkExtension update scenario, specifically error 13 OSSystemExtensionErrorAuthorizationRequired the error is happening in our Network Extension preinstall script when we try to remove the previous installation What is the recommended way to approach this situation?
1
0
234
Feb ’24
Supervise device without erasing data?
Hello! I made an iOS app for a research study that blocks network connections with certain websites. I need to block around 2000 web domains. To achieve this, I had two options: Use Screentime API Use Network Extension Screentime API has a limitation that limits the number of websites it can block to 50 (https://developer.apple.com/documentation/managedsettings/webcontentsettings/blockedbyfilter-swift.property). The Network Extension on the other hand requires my device to be in supervised mode, which as I understand it, involves erasing the data on the phone and resetting it. Hence, I am here to ask if there is a way to do this without erasing user data when setting the device into supervised mode. Also, I am open to hearing any other alternatives I could pursue. Thanks!!
2
0
546
Feb ’24
Add Network Extensions capability to iOS app without joining Apple Developer Program?
I want to build an iOS VPN app for personal use only, so I need to add the NetworkExtensions capability (according to my understanding) From Apple's documentation on "Adding Capabilities to Your App": The platform, and whether you're a member of the Apple Developer Program, may limit the capabilities available to your app The documentation doesn't explicitly say which capabilities require being a part of the Apple Developer Program. I also don't see why I'd need to be a part of the Apple Developer Program to write software for personal use. Note that, at least to my knowledge, the NetworkExtensions capability does not depend on any service from Apple (as opposed to HealthKit or Game Center). So is there a way to add a Network Extensions capability to an iOS app without joining the Apple Developer Program?
1
0
420
Feb ’24
Xcode 15: Not able to attach system extension process to Instruments tool
Xcode Version 15.2 (15C500b) After upgrading Xcode from 14 to 15.2 I am not able to attach system extension (packettunnel) process to Instruments tools for memory debugging. Same is working fine with Xcode 14. Error displayed: "Process No Longer Exists". But the service is running and is listed in process list. % ps -ax | grep -i pkttunnel | grep -v grep 61910 ?? 0:01.04 /Library/SystemExtensions/5F4AF6EF-****-****-****-F11****9CE78/com.******.client.*****-Client.***ui.***pkttunnel.systemextension/Contents/MacOS/com.******.client.*****-Client.***ui.***pkttunnel.systemextension Note: I am able to attach a normal program to Instruments tool for memory debugging, I have noticed this issue with system extension processes only.
3
0
739
Feb ’24
[macOS] Encountering DNS cache issues while using NETransparentProxyProvider.
Hi Team, We are using NETransparentProxyProvider, and we have observed that whenever we set setNetworkInterface with NENetworkRule, it always generates the DNS query even if the TTL time has not passed. However, when I stop the NETransparentProxyManager using stopVPNTunnel and set setNetworkInterface as nil, it will not re-issue the DNS query until the DNS TTL time has passed.
6
0
798
Feb ’24
Network extension process not getting auto launch after installation
I have a Network extension contains App Proxy and Content Filter. After installation, extension process is not getting auto launch. We want to execute some code in main.swift. extension process is getting launch on enabling either App Proxy or Content Filter. how to launch network extension process after installation? Installations Sample code: let activationRequest = OSSystemExtensionRequest.activationRequest(forExtensionWithIdentifier: id, queue: .main) OSSystemExtensionManager.shared.submitRequest(activationRequest)
3
0
538
Feb ’24
Wifi Connection in Guided access mode.
Hi, I am developing an iPad application which will run in guided access mode. This will be an Enterprise app. the use case is we will provide iPad to our customers with the application installed in it and guided access mode is on and wi-fi is also on. Now I want users to connect to their own wifi setup at their home (SSID name and password as input field within the app) So is there any way user can connect to their wifi from within the application entering SSID and password in Guided access mode ? Or is there is any way user can scan the wifi at their home and connect to on of them by providing password from inside the application. Application will run in Guided access mode only.
3
0
517
Feb ’24
BSD Sockets APIs compatibility with IPv4-mapped IPv6 addresses
I'm interested in whether SOCKET APIS like bind, accept, and connect can seamlessly work with a mapped IPv6 address like 64:ff9b::103.135.122.10 or any other IPv4-mapped IPv6 addresses? I've consulted the following thread for reference and it is stated: We do not support under-the-sockets bump-in-API (RFC 3338) and we do not support 464XLAT... https://developer.apple.com/forums/thread/5643. If it can support, what is above thread about?
1
0
298
Feb ’24
Peer-to-Peer communications on devices on different networks
I am struggling to sort through the options for building an application that can send and receive messages peer-to-peer to any device connected to any network anywhere in the world. I know I will likely need a relay server to handle DNS and I will also need to handle changing IP addresses as mobile devices move around and their IP address changes. What I am puzzled about is I've read up on Bonjour and on the Network framework and it appears to me (and I may be wrong) that these capabilities only support either devices on the same local network, or devices that are in close proximity to one another. For an iOS application, what is the recommended service or framework to use to build the send/receive functionality in the app? Is it even possible? Thanks!
1
0
293
Feb ’24
Entitlement not being recognized by Xcode?
Hello! I have never distributed an apple app before. Right now, I am trying to distribute a macOS app. I created a provisioning profile of type "Developer ID Application" and it has the following capabilities enabled. Now, when I download the profile and use it for my app, xcode gives me the following error: Lmk what I need to do since I am super unfamiliar with this process.
1
0
468
Feb ’24
Monitoring for network changes while backgrounded or suspended
Detecting New WiFi Connection + WiFi Details What I want to accomplish: The app, including when backgrounded or suspended, creates a local notification (assuming the app has permission for notifications) when there is a new WiFi network being used and ideally being able to execute some small code to customize the notification. This code would also have access to SSID info, security type, etc., so the sort of info in NEHotspotNetwork. A number of apps seem able to do this but I am having trouble replicating what they are doing. What I’ve looked at or tried: Looking at “TN3111: iOS Wi-Fi API overview” https://developer.apple.com/documentation/technotes/tn3111-ios-wifi-api-overview Navigate an internet hotspot (NEHotspotHelper) Doesn’t look like NEHotspotHelper would provide the above functionality for detecting changes while backgrounded and it seems to indicate that the special entitlement com.apple.developer.networking.HotspotHelper would not be granted for this use case anyway. Add an accessory to the user’s network (Wireless Accessory Configuration (WAC) or HomeKit) Doesn’t seem relevant to my use case Peer-to-peer networking Doesn’t seem relevant to my use case Location tracking I don’t want to know my user’s location and Lookout and Norton 360 (just two of many examples) don’t request or have location permissions (or request any permissions for that matter except notifications) and are still able to obtain the WiFi network info without it as well as detect changes in the background. Current Wi-Fi network NEHotspotNetwork .fetchCurrent(completionHandler:) So this is the most obvious since it returns the info I want but it requires the following permissions or configurations that neither Lookout or Norton 360 are requesting and also I don’t see how this API would trigger a backgrounded app to run, more for when your app is in the foreground and able to run already. From Apple docs: “This method produces a non-nil NEHotspotNetwork object only when the current network environment meets all four of the following critieria: The app is using the Core Location API and has user’s authorization to access precise location. The app used the NEHotspotConfiguration API to configure the current Wi-Fi network. The app has active VPN configurations installed. The app has an active NEDNSSettingsManager configuration installed. This method also requires the app to have the Access Wi-Fi Information Entitlement, and produces nil if the app lacks this entitlement.” Once again, apps that are able to do what I want don't seem to have location permissions, no VPN profile, no DNS config, no hotspot config.... Additional things I’ve considered that are not mentioned in the above: Using NWPathMonitor works for identifying a change, doesn’t trigger when app backgrounded and no access to SSID or other WiFi info. What am I missing? Is there some API that I totally missed? Thank you! Colin
1
0
685
Feb ’24
"Error Domain=NEAgentErrorDomain Code=2" appears..
I am a novice Swift developer. Referring to the Apple developer documentation and various blogs, I have written example code for DNS Proxy in Network Extension. I inherited NEDNSProxyProvider to create a DNSProxyProvider class in the Extension. Using NEDNSProxyManager and NEDNSSettingsManager, I created a simple app that calls saveToPreferences(...) after loadFromPreferences(...). When saveToPreferences(...) is called, I can confirm that the "DNS Proxy" item is added to the "System Preferences" in the "Enabled" state. However, upon further inspection using console logs, it seems that the init() constructor and startProxy(...) function of DNSProxyProvider are not being called. Additionally, upon checking the console logs: NESMDNSProxySession[Primary Tunnel:MyMyService:{GUID}:(null)] in state NESMVPNSessionStateStarting: plugin NEDNSProxyPlugin(xxxxx.xxxxxx.MyMyService[inactive]) started with PID 0 error Error Domain=NEAgentErrorDomain Code=2 "(null)" These logs are present. Could they be related to the issue? I tried to refer to the link below that seems like a similar issue, but I couldn't find a clear solution or hint. https://forums.developer.apple.com/forums/thread/130063 https://developer.apple.com/forums/thread/680905 https://developer.apple.com/forums/thread/675304 https://developers.apple.com/forums/thread/652708 https://developer.apple.com/forums/thread/678399 I earnestly seek your assistance. Thank you.
7
0
761
Feb ’24