General:
Forums subtopic: App & System Services > Networking
TN3151 Choosing the right networking API
Networking Overview document — Despite the fact that this is in the archive, this is still really useful.
TLS for App Developers forums post
Choosing a Network Debugging Tool documentation
WWDC 2019 Session 712 Advances in Networking, Part 1 — This explains the concept of constrained networking, which is Apple’s preferred solution to questions like How do I check whether I’m on Wi-Fi?
TN3135 Low-level networking on watchOS
TN3179 Understanding local network privacy
Adapt to changing network conditions tech talk
Understanding Also-Ran Connections forums post
Extra-ordinary Networking forums post
Foundation networking:
Forums tags: Foundation, CFNetwork
URL Loading System documentation — NSURLSession, or URLSession in Swift, is the recommended API for HTTP[S] on Apple platforms.
Moving to Fewer, Larger Transfers forums post
Testing Background Session Code forums post
Network framework:
Forums tag: Network
Network framework documentation — Network framework is the recommended API for TCP, UDP, and QUIC on Apple platforms.
Building a custom peer-to-peer protocol sample code (aka TicTacToe)
Implementing netcat with Network Framework sample code (aka nwcat)
Configuring a Wi-Fi accessory to join a network sample code
Moving from Multipeer Connectivity to Network Framework forums post
NWEndpoint History and Advice forums post
Network Extension (including Wi-Fi on iOS):
See Network Extension Resources
Wi-Fi Fundamentals
TN3111 iOS Wi-Fi API overview
Wi-Fi Aware framework documentation
Wi-Fi on macOS:
Forums tag: Core WLAN
Core WLAN framework documentation
Wi-Fi Fundamentals
Secure networking:
Forums tags: Security
Apple Platform Security support document
Preventing Insecure Network Connections documentation — This is all about App Transport Security (ATS).
WWDC 2017 Session 701 Your Apps and Evolving Network Security Standards [1] — This is generally interesting, but the section starting at 17:40 is, AFAIK, the best information from Apple about how certificate revocation works on modern systems.
Available trusted root certificates for Apple operating systems support article
Requirements for trusted certificates in iOS 13 and macOS 10.15 support article
About upcoming limits on trusted certificates support article
Apple’s Certificate Transparency policy support article
What’s new for enterprise in iOS 18 support article — This discusses new key usage requirements.
Technote 2232 HTTPS Server Trust Evaluation
Technote 2326 Creating Certificates for TLS Testing
QA1948 HTTPS and Test Servers
Miscellaneous:
More network-related forums tags: 5G, QUIC, Bonjour
On FTP forums post
Using the Multicast Networking Additional Capability forums post
Investigating Network Latency Problems forums post
WirelessInsights framework documentation
iOS Network Signal Strength forums post
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] This video is no longer available from Apple, but the URL should help you locate other sources of this info.
Networking
RSS for tagExplore the networking protocols and technologies used by the device to connect to Wi-Fi networks, Bluetooth devices, and cellular data services.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Problem description
Since macOS Sequoia, our users have experienced issues with multicast traffic in our macOS app. Regularly, the app starts but cannot receive multicast, or multicast eventually stops mid-execution. The app sometimes asks again for Local Network permission, while it was already allowed so. Several versions of our app on a single machine are sometimes (but not always) shown as different instances in the System Settings > Privacy & Security > Local Network list. And when several instances are shown in that list, disabling one disables all of them, but it does not actually forbids the app from receiving multicast traffic. All of those issues are experienced by an increasing number of users after they update their system from macOS 14 to macOS 15 or 26, and many of them have reported networking issues during production-critical moments.
We haven't been able to find the root cause of those issues, so we built a simple test app, called "FM Mac App Test", that can reproduce multicast issues. This app creates a GCDAsyncUdpSocket socket to receive multicast packets from a piece of hardware we also develop, and displays a simple UI showing if such packets are received. The app is entitled with "Custom Network Protocol", is built against x86_64 and arm64, and is archived (signed and notarized). We can share the source code if requested.
Out of the many issues our main app exhibits, the test app showcases some:
The app asks several times for Local Network permission, even after being allowed so previously. After allowing the app's Local Network and rebooting the machine, the System Settings > Privacy & Security > Local Network does not show the app, and the app asks again for Local Network access.
The app shows a different Local Network Usage Description than in the project's plist.
Several versions of the app appear as different instances in the Privacy list, and behave strangely. Toggling on or off one instance toggles the others. Only one version of the app seems affected by the setting, the other versions always seem to have access to Local Network even when the toggle is set to off.
We even did see messages from different app versions in different user accounts. This seems to contradicts Apple's documentation that states user accounts have independent Privacy settings.
Can you help us understand what we are missing (in terms of build settings, entitlements, proper archiving...) so our app conforms to what macOS expects for proper Local Network behavior?
Related material
Local Network Privacy breaks Application: this issue seemed related to ours, but the fix was to ensure different versions of the app have different UUIDs. We ensured that ourselves, to no improvement.
Local Network FAQ
Technote TN3179
Steps to Reproduce
Test App is developed on Xcode 15.4 (15F31d) on macOS 14.5 (23F79), and runs on macOS 26.0.1 (25A362). We can share the source code if requested.
On a clean install of macOS Tahoe (our test setup used macOS 26.0.1 on a Mac mini M2 8GB), we upload the app (version 5.1).
We run the app, make sure the selected NIC is the proper one, and open the multicast socket. The app asks us to allow Local Network, we allow it. The alert shows a different Local Network Usage Description than the one we set in our project's plist.
The app properly shows packets are received from the console on our LAN.
We check the list in System Settings > Privacy & Security > Local Network, it includes our app properly allowed.
We then reboot the machine. After reboot, the same list does not show the app anymore.
We run the app, it asks again about Local Network access (still with incorrect Usage Description). We allow it again, but no console packet is received yet. Only after closing and reopening the socket are the console packets received.
After a 2nd reboot, the System Settings > Privacy & Security > Local Network list shows correctly the app. The app seems to now run fine.
We then upload an updated version of the same app (5.2), also built and notarized. The 2nd version is simulating when we send different versions of our main app to our users. The updated version has a different UUID than the 1st version.
The updated version also asks for Local Network access, this time with proper Usage Description.
A 3rd updated version of the app (5.3, also with unique UUID) behaves the same. The System Settings > Privacy & Security > Local Network list shows three instances of the app.
We toggle off one of the app, all of them toggle off. The 1st version of the app (5.1) does not have local network access anymore, but both 2nd and 3rd versions do, while their toggle button seems off.
We toggle on one of the app, all of them toggle on. All 3 versions have local network access.
Hi, I’m implementing a NetworkExtension content filter provider on iOS and I can’t get it to activate on device.
I have an iOS app (App Store distribution) with a content filter provider extension (NEFilterDataProvider). The app builds, installs, and runs fine, and the extension is embedded correctly. Entitlements appear to be set for both the app and the extension, and the extension’s Info.plist is configured as expected.
However, when I try to enable the filter via NEFilterManager (loadFromPreferences → set configuration → isEnabled = true → saveToPreferences), saveToPreferences fails with NEFilterErrorDomain code 1 and the message “Configuration invalid or read/write failed.” The extension never starts and startFilter() is never called.
Main app bundle ID: uk.co.getnovi.student
Extension bundle ID: uk.co.getnovi.student.NoviContentFilter
Extension type: NEFilterDataProvider
We are testing on an iPhone 15 running iOS 18.6.2 (22G100).
This app is intended for education use on student-owned personal iPhones installed from the App Store. The devices we are testing on are not supervised and not enrolled in MDM. We already use the Family Controls framework (ManagedSettings) for app restrictions and have the com.apple.developer.family-controls entitlement enabled for App Store distribution.
I’ve read TN3134 and noticed content filter providers on iOS are described as “supervised devices only” in general, with additional notes around iOS 15.0 for “apps using Screen Time APIs” and iOS 16.0 for “per-app on managed devices,” plus a note that in the Screen Time case content filters are only supported on child devices.
My question is whether this error is what you’d expect when attempting to enable a content filter provider on a non-supervised, non-managed device, or whether this should still work if the entitlement and configuration are correct. If non-supervised devices are not supported, is there any supported path for enabling NEFilter on iOS without supervision/MDM (for example via the Screen Time / Family Controls child authorization pathway), or will the system always refuse to enable the filter on standard devices?
TLDR: is NEFilterDataProvider supported on non-supervised devices for consumer App Store apps, or is this a platform restriction that cannot be worked around?
Thanks,
Matt
Hey!
Wa are developing a VPN app for iOS and whenever we enable enforceRoutes we see 20% to 30% download and upload speed drop.
Here are example results from our environment:
| Upload | Download |
------------------------------------------
enforceRoutes off | 337.65 | 485.38 |
------------------------------------------
enforceRoutes on | 236.75 | 357.80 |
------------------------------------------
Is this behavior known and expected? Is there anything we can do to mitigate the effect of enforceRoutes in our application?
Test were performed on iOS 26.2.1.
Topic:
App & System Services
SubTopic:
Networking
Hello team,
I am trying to find out a way to block urls in the chrome browser if it is found in local blocked list cache. I found URL Filter Network very much suitable for my requirement. But I see at multiple places that this solution is only for Enterprise level or MDM or supervised device. So can I run this for normal user ? as my targeting audience would be bank users. One more thing how can I test this in development environment if we need supervised devices and do we need special entitlement ?
When trying to run sample project in the simulator then getting below error
I've recently updated one of our CI mac mini's to Sequoia in preparation for the transition to Tahoe later this year. Most things seemed to work just fine, however I see this dialog whenever the UI Tests try to run.
This application BoostBrowerUITest-Runner is auto-generated by Xcode to launch your application and then run your UI Tests. We do not have any control over it, which is why this is most surprising.
I've checked the codesigning identity with codesign -d -vvvv
as well as looked at it's Info.plist and indeed the usage descriptions for everything are present (again, this is autogenerated, so I'm not surprised, but just wanted to confirm the string from the dialog was coming from this app)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>22A380021</string>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>BoostBrowserUITests-Runner</string>
<key>CFBundleIdentifier</key>
<string>company.thebrowser.Browser2UITests.xctrunner</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>BoostBrowserUITests-Runner</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>24A324</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>15.0</string>
<key>DTSDKBuild</key>
<string>24A324</string>
<key>DTSDKName</key>
<string>macosx15.0.internal</string>
<key>DTXcode</key>
<string>1620</string>
<key>DTXcodeBuild</key>
<string>16C5031c</string>
<key>LSBackgroundOnly</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>13.0</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSAppleEventsUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSCalendarsUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSCameraUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSContactsUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSDesktopFolderUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSDocumentsFolderUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSDownloadsFolderUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSFileProviderDomainUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSFileProviderPresenceUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSLocalNetworkUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSLocationUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSMotionUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSNetworkVolumesUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSRemindersUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSRemovableVolumesUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSSystemAdministrationUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>NSSystemExtensionUsageDescription</key>
<string>Access is necessary for automated testing.</string>
<key>OSBundleUsageDescription</key>
<string>Access is necessary for automated testing.</string>
</dict>
</plist>
Additionally, spctl --assess --type execute BoostBrowserUITests-Runner.app return an exit code of 0 so I assume that means it can launch just fine, and applications are allowed to be run from "anywhere" in System Settings.
I've found the XCUIProtectedResource.localNetwork value, but it seems to only be accessible on iOS for some reason (FB17829325).
I'm trying to figure out why this is happening on this machine so I can either fix our code or fix the machine. I have an Apple script that will allow it, but it's fiddly and I'd prefer to fix this the correct way either with the machine or with fixing our testing code.
I have a network extension that hosts a NEFilterDataProvider & NETransparentProxyProvider.
One of the use case that this caters to is :
Proxy some flows (depending on originating app) while Content filter is also filtering flows based on business logic.
The issue I am running into happens when
FilterDataProvider sees a flow & responds with
filterDataVerdict(withFilterInbound: false, peekInboundBytes: 0, filterOutbound: true, peekOutboundBytes:1024
to handleNewFlow(_ flow: NEFilterFlow) [wants to peek more bytes on outbound connection before making a decision]
TransparentProxyProvider sees the flow & responds with NO
to handleNewFlow(_ flow: NEAppProxyFlow) as it is not interested in in proxying that flow.
When this occurs, we see connection being dropped by kernel. I wanted to know if this is expected behavior.
Logs when this occurs:
2026-02-06 14:57:09.725854-0600 0x17c918f Default 0x0 569 0 com.test.networkextension: (NetworkExtension) [com.apple.networkextension:] [Extension com.test.network]: provider rejected new flow TCP headless_shell[{length = 20, bytes = 0xe69023e655b6065e1a2f94fa508807fa43f6ac8a}] remote: 100.72.0.3:443 interface utun9
2026-02-06 14:57:09.725874-0600 0x17ca166 Debug 0x0 569 0 com.test.networkextension: (NetworkExtension) [com.apple.networkextension:] New flow verdict for D89B5B5D-793C-4940-D955-37BE33F18005:
drop = NO
remediate = NO
needRules = NO
shouldReport = YES
pause = NO
urlAppendString = NO
filterInbound = NO
peekInboundBytes = 0
filterOutbound = YES
peekOutboundBytes = 1024
statisticsReportFrequency = low
2026-02-06 14:57:09.726009-0600 0x17ca24a Default 0x0 569 0 com.test.networkextension: (libnetworkextension.dylib) [com.apple.networkextension:] (410011084): Closing reads (sending SHUT_WR), closed by plugin (flow error: 0)
2026-02-06 14:57:09.726028-0600 0x17ca24a Default 0x0 569 0 com.test.networkextension: (libnetworkextension.dylib) [com.apple.networkextension:] (410011084): Closing writes, sending SHUT_RD
2026-02-06 14:57:09.726040-0600 0x17ca24a Debug 0x0 569 0 com.test.networkextension: (libnetworkextension.dylib) [com.apple.networkextension:] (410011084): Dropping the director
2026-02-06 14:57:09.726047-0600 0x17ca24a Default 0x0 569 0 com.test.networkextension: (libnetworkextension.dylib) [com.apple.networkextension:] (410011084): Destroying, client tx 0, client rx 0, kernel rx 0, kernel tx 0
I wanted to know how neagent is handling this when for a flow, filterDataProvider wants to look at the traffic while transparentProxy is not interested in handling that flow
We create custom VPN tunnel by overriding PacketTunnelProvider on MacOS. Normal VPN connection works seamlessly. But if we enable onDemand rules on VPN manager, intemittently during tunnel creation via OnDemand, internet goes away on machine leading to a connection stuck state.
Why does internet goes away during tunnel creation?
iOS mTLS Client Certificate Authentication Fails in TestFlight with Error -25303
Problem
I'm building an iOS app that uses mTLS (client certificates received from server at runtime). Storing SecCertificate to keychain fails with error -25303 in both development and TestFlight builds, preventing SecIdentity creation needed for URLSession authentication.
Environment: iOS 18.2, iPad Pro, TestFlight internal testing, keychain-access-groups properly configured
Diagnostic Results
Testing keychain operations shows an interesting pattern:
✅ Generic Password - Works:
let addQuery: [CFString: Any] = [
kSecClass: kSecClassGenericPassword,
kSecAttrAccount: "test",
kSecValueData: "password".data(using: .utf8)!
]
SecItemAdd(addQuery as CFDictionary, nil) // Returns: 0 (success)
✅ SecKey - Works:
let addKeyQuery: [CFString: Any] = [
kSecClass: kSecClassKey,
kSecValueRef: privateKey,
kSecAttrApplicationTag: tag
]
SecItemAdd(addKeyQuery as CFDictionary, nil) // Returns: 0 (success)
❌ SecCertificate - Fails:
let addCertQuery: [CFString: Any] = [
kSecClass: kSecClassCertificate,
kSecValueRef: certificate, // Created from server-provided PEM
kSecAttrApplicationTag: tag
]
SecItemAdd(addCertQuery as CFDictionary, nil) // Returns: -25303
Code Context
Attempting to create SecIdentity for mTLS:
private func createIdentity(fromCert certPEM: String, key keyPEM: String) throws -> SecIdentity {
// 1. Parse PEM to DER and create SecCertificate - succeeds
guard let certData = extractPEMData(from: certPEM, type: "CERTIFICATE"),
let certificate = SecCertificateCreateWithData(nil, certData as CFData) else {
throw CertificateError.invalidCertificate
}
// 2. Parse PEM key and create SecKey - succeeds
guard let keyData = extractPEMData(from: keyPEM, type: "PRIVATE KEY"),
let privateKey = SecKeyCreateWithData(keyData as CFData, attrs as CFDictionary, &error) else {
throw CertificateError.invalidKey
}
// 3. Add key to keychain - SUCCEEDS (errSecSuccess)
let tempTag = UUID().uuidString.data(using: .utf8)!
SecItemAdd([
kSecClass: kSecClassKey,
kSecValueRef: privateKey,
kSecAttrApplicationTag: tempTag
] as CFDictionary, nil) // ✅ Works
// 4. Add certificate to keychain - FAILS (-25303)
let status = SecItemAdd([
kSecClass: kSecClassCertificate,
kSecValueRef: certificate,
kSecAttrApplicationTag: tempTag
] as CFDictionary, nil) // ❌ Fails with -25303
guard status == errSecSuccess else {
throw CertificateError.keychainError(status)
}
// 5. Would query for SecIdentity (never reached)
// ...
}
Network Behavior
When mTLS fails, console shows:
Connection: asked for TLS Client Certificates
Connection: received response for client certificates (-1 elements)
Connection: providing TLS Client Identity (-1 elements)
Task received response, status 403
The -1 elements indicates no certificates were provided.
Entitlements
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.ellin.tshios</string>
</array>
Keychain Sharing capability is enabled.
What I've Tried
Both kSecValueRef and kSecValueData approaches - same error
Various kSecAttrAccessible values - same error
Different keychain access groups - same error
TestFlight build (vs dev build) - same error
PKCS#12 creation - requires complex ASN.1/DER encoding, no iOS API
Questions
Is error -25303 expected when adding SecCertificate in development/TestFlight builds?
Will App Store distribution resolve this? Or is there a fundamental limitation?
Why does SecKey succeed but SecCertificate fails with identical entitlements?
Is there an alternative to create SecIdentity without keychain access?
Constraints
Certificates come from server at runtime (cannot bundle)
Need SecIdentity for URLSession client certificate authentication
Server provides PEM format certificates
Tested on: Simulator (dev), iPad Pro (dev), iPad Pro (TestFlight) - all fail
Any insights appreciated - specifically whether this is a provisioning profile limitation that App Store distribution would resolve.
I’m using Network Framework with UDP and calling:
connection.receive(minimumIncompleteLength: 1,
maximumLength: 1500) { data, context, isComplete, error in
... // Some Logic
}
Is it possible for this completion handler to be called with data==nil if I haven't received any kind of error, i.e., error==nil and the connection is still in the .ready state?
I’m building a macOS app with a DNS Proxy system extension for Developer ID + notarization, deployed via MDM, and Xcode fails the Developer ID Release build with a provisioning profile mismatch for com.apple.developer.networking.networkextension.
Environment
macOS: Sequoia (15.7.2)
Xcode: 26.2
Distribution: Developer ID + notarization, deployed via MDM
Host bundle ID: com.mydns.agent.MyDNSMacProxy
DNS Proxy system extension bundle ID: com.mydns.agent.MyDNSMacProxy.dnsProxy
Host entitlements (Release):
File: MyDNSMacProxy/MyDNSMacProxyRelease.entitlements:
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.application-identifier</key>
<string>B234657989.com.mydns.agent.MyDNSMacProxy</string>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>dns-proxy</string>
</array>
<key>com.apple.developer.system-extension.install</key>
<true/>
<key>com.apple.developer.team-identifier</key>
<string>B234657989</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.mydns.MyDNSmac</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>B234657989.*</string>
</array>
</dict>
</plist>
xcodebuild -showBuildSettings -scheme MyDNSMacProxy -configuration Release :
PROVISIONING_PROFILE_SPECIFIER = main MyDNSMacProxy5
CODE_SIGN_IDENTITY = Developer ID Application
Host Developer ID profile
main_MyDNSMacProxy5.provisionprofile (via security cms -D):
"Entitlements" => {
"com.apple.application-identifier" => "B234657989.com.mydns.agent.MyDNSMacProxy"
"com.apple.developer.team-identifier" => "B234657989"
"com.apple.security.application-groups" => [ "group.com.mydns.MyDNSmac", ..., "B234657989.*" ]
"keychain-access-groups" => [ "B234657989.*" ]
"com.apple.developer.system-extension.install" => 1
"com.apple.developer.networking.networkextension" => [
"packet-tunnel-provider-systemextension",
"app-proxy-provider-systemextension",
"content-filter-provider-systemextension",
"dns-proxy-systemextension",
"dns-settings",
"relay",
"url-filter-provider",
"hotspot-provider"
]
}
So:
App ID, team ID, keychain and system‑extension.install match.
The profile’s com.apple.developer.networking.networkextension is a superset of what I request in the host entitlements (dns-proxy only).
System extension (for context)
DNS Proxy system extension target:
NSExtensionPointIdentifier = com.apple.dns-proxy
NetworkExtension → NEProviderClasses → com.apple.networkextension.dns-proxy → my provider class
Entitlements: com.apple.developer.networking.networkextension = ["dns-proxy-systemextension"]
This target uses a separate Developer ID profile and builds successfully.
Xcode error
Release build of the host fails with:
…MyDNSMacProxy.xcodeproj: error: Provisioning profile "main MyDNSMacProxy5" doesn't match the entitlements file's value for the com.apple.developer.networking.networkextension entitlement. (in target 'MyDNSMacProxy' from project 'MyDNSMacProxy')
Xcode UI also says:
Entitlements: 6 Included, 1 Missing Includes com.apple.developer.team-identifier, com.apple.application-identifier, keychain-access-groups, com.apple.developer.system-extension.install, and com.apple.security.application-groups. Doesn’t match entitlements file value for com.apple.developer.networking.networkextension.
Because of this, the app bundle isn’t produced and I can’t inspect the final signed entitlements.
Questions:
For com.apple.developer.networking.networkextension, should Xcode accept a subset of values in the entitlements (here just dns-proxy) as long as that value is allowed by the Developer ID profile, or does it currently require a stricter match?
Is the following configuration valid for Developer ID + MDM with a DNS Proxy system extension:
Host entitlements: ["dns-proxy"]
System extension entitlements: ["dns-proxy-systemextension"]
Host profile’s NE array includes the DNS Proxy system extension types.
If this is a known limitation or bug in how Xcode validates NE entitlements for Developer ID, is there a recommended workaround?
Thanks for any guidance.
Topic:
App & System Services
SubTopic:
Networking
Tags:
Network Extension
System Extensions
Code Signing
Developer ID
Hello,
We are implementing a Transparent Proxy using NETransparentProxyProvider and configuring NETransparentProxyNetworkSettings with NENetworkRule.
Currently, NENetworkRule requires:
NENetworkRule(
destinationHost: NWHostEndpoint(hostname: String, port: String),
protocol: .TCP / .UDP / .any
)
NWHostEndpoint.port accepts only a single port value (as a String) or an empty string for all ports.
At present, we are creating a separate NENetworkRule for each port in the range (ex for range 49152–65535 approximately 16,384 rules). After deploying this configuration, we observe the following behavior:
nesessionmanager starts consuming very high CPU (near 100%)
The system becomes unresponsive
The device eventually hangs and restarts automatically
The behavior resembles a kernel panic scenario
This strongly suggests that creating thousands of NENetworkRule entries may not be a supported or scalable approach.
Questions:
Is there any officially supported way to specify a port range in NENetworkRule?
Is creating thousands of rules (one per port) considered acceptable or supported?
Is the recommended design to intercept broadly (e.g., port = "") and filter port ranges inside handleNewTCPFlow / handleNewUDPFlow instead?
Are there documented system limits for the number of NENetworkRule entries allowed in NETransparentProxyNetworkSettings?
Hi, I’m implementing a NetworkExtension content filter provider on iOS and I can’t get it to activate on device.
I have an iOS app (App Store distribution) with a content filter provider extension (NEFilterDataProvider). The app builds, installs, and runs fine, and the extension is embedded correctly. Entitlements appear to be set for both the app and the extension, and the extension’s Info.plist is configured as expected.
However, when I try to enable the filter via NEFilterManager (loadFromPreferences → set configuration → isEnabled = true → saveToPreferences), saveToPreferences fails with NEFilterErrorDomain code 1 and the message “Configuration invalid or read/write failed.” The extension never starts and startFilter() is never called.
Main app bundle ID: uk.co.getnovi.student
Extension bundle ID: uk.co.getnovi.student.NoviContentFilter
Extension type: NEFilterDataProvider
We are testing on an iPhone 15 running iOS 18.6.2 (22G100), the app is designed to run on iPhone.
This app is intended for education use on student-owned personal iPhones installed from the App Store. The devices we are testing on are not supervised and not enrolled in MDM. We already use the Family Controls framework (ManagedSettings) for app restrictions and have the com.apple.developer.family-controls entitlement enabled for App Store distribution.
I’ve read TN3134 and noticed content filter providers on iOS are described as “supervised devices only” in general, with additional notes around iOS 15.0 for “apps using Screen Time APIs” and iOS 16.0 for “per-app on managed devices,” plus a note that in the Screen Time case content filters are only supported on child devices.
My question is whether this error is what you’d expect when attempting to enable a content filter provider on a non-supervised, non-managed device, or whether this should still work if the entitlement and configuration are correct. If non-supervised devices are not supported, is there any supported path for enabling NEFilter on iOS without supervision/MDM (for example via the Screen Time / Family Controls child authorization pathway), or will the system always refuse to enable the filter on standard devices?
In summary: is NEFilterDataProvider supported on non-supervised devices for consumer App Store apps, or is this a platform restriction that cannot be worked around?
Thanks,
Matt
Hi,
I tried to follow this guide:
https://developer.apple.com/documentation/networkextension/filtering-traffic-by-url
And this:
https://github.com/apple/pir-service-example
I already deploy the pir service on my server. And set the configuration on the app like this:
{
name = SimpleURLFilter
identifier = xxxxx
applicationName = SimpleURLFilter
application = com.xxxx.SimpleURLFilter
grade = 2
urlFilter = {
Enabled = YES
FailClosed = NO
AppBundleIdentifier = com.mastersystem.SimpleURLFilter
ControlProviderBundleIdentifier = com.xxxx.SimpleURLFilter.SimpleURLFilterExtension
PrefilterFetchFrequency = 2700
pirServerURL = https://xxxxx/pir
pirPrivacyPassIssuerURL = https://xxxxx/pir
AuthenticationToken = AAAA
pirPrivacyProxyFailOpen = NO
pirSkipRegistration = NO
}
}
But I got this error when I tried to enable the service on the app:
Received filter status change: <FilterStatus: 'stopped' errorMessage: 'The operation couldn’t be completed. (NetworkExtension.NEURLFilterManager.Error error 9.)'>
What does that error mean? And how to fix it?
Description
I am seeing a consistent crash in a NEDNSProxyProvider on iOS when migrating from completion handlers to the new Swift Concurrency async/await variants of readDatagrams() and writeDatagrams() on NEAppProxyUDPFlow.
The crash occurs inside the Swift Concurrency runtime during task resumption. Specifically, it seems the Task attempts to return to the flow’s internal serial executor (NEFlow queue) after a suspension point, but fails if the flow was invalidated or deallocated by the kernel while the task was suspended.
Error Signature
Thread 4: EXC_BAD_ACCESS (code=1, address=0x28)
Thread 4 Queue : NEFlow queue (serial)
#0 0x000000018fe919cc in swift::AsyncTask::flagAsAndEnqueueOnExecutor ()
#9 0x00000001ee25c3b8 in _pthread_wqthread ()
Steps
The crash is highly timing-dependent. To reproduce it reliably:
Use an iOS device with Developer Settings enabled.
Go to Developer > Network Link Conditioner -> High Latency DNS.
Intercept a DNS query and perform a DoH (DNS-over-HTTPS) request using URLSession.
The first few network requests should trigger the crash
Minimum Working Example (MWE)
class DNSProxyProvider: NEDNSProxyProvider {
override func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool {
guard let udpFlow = flow as? NEAppProxyUDPFlow else { return false }
Task(priority: .userInitiated) {
await handleUDPFlow(udpFlow)
}
return true
}
func handleUDPFlow(_ flow: NEAppProxyUDPFlow) async {
do {
try await flow.open(withLocalFlowEndpoint: nil)
while !Task.isCancelled {
// Suspension point 1: Waiting for datagrams
let (flowData, error) = await flow.readDatagrams()
if let error { throw error }
guard let flowData, !flowData.isEmpty else { return }
var responses: [(Data, Network.NWEndpoint)] = []
for (data, endpoint) in flowData {
// Suspension point 2: External DoH resolution
let response = try await resolveViaDoH(data)
responses.append((response, endpoint))
}
// Suspension point 3: Writing back to the flow
// Extension will crash here on task resumption
try await flow.writeDatagrams(responses)
}
} catch {
flow.closeReadWithError(error)
flow.closeWriteWithError(error)
}
}
private func handleFlowData(_ packet: Data, endpoint: Network.NWEndpoint, using parameters: NWParameters) async throws -> Data {
let url = URL(string: "https://dns.google/dns-query")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.httpBody = packet
request.setValue("application/dns-message", forHTTPHeaderField: "Content-Type")
let (data, _) = try await URLSession.shared.data(for: request)
return data
}
}
Crash Details & Analysis
The disassembly at the crash point indicates a null dereference of an internal executor pointer (Voucher context):
ldr x20, [TPIDRRO_EL0 + 0x340]
ldr x0, [x20, #0x28] // x20 is NULL/0x0 here, resulting in address 0x28
It appears that NEAppProxyUDPFlow’s async methods bind the Task to a specific internal executor. When the kernel reclaims the flow memory, the pointer in x20 becomes invalid. Because the Swift runtime is unaware that the NEFlow queue executor has vanished, it attempts to resume on non-existing flow and then crashes.
Checking !Task.isCancelled does not prevent this, as the crash happens during the transition into the task body before the cancellation check can even run.
Questions
Is this a known issue of the NetworkExtension async bridge?
Why does Task.isCancelled not reflect the deallocation of the underlying NEAppProxyFlow?
Is the only safe workaround?
Please feel free to correct me if I misunderstood anything here. I'll be happy to hear any insights or suggestions :) Thank you!
My iOS application needs to connect a device by wifi and exchange data between them.
The way of transmission is using the UDP protocol, most of all, it works well. But some part of iOS devices will loss the package always. Even if re-open the application or reboot wifi devices, or reboot iOS devices, it can not be solved.
Only reset the network settings on iOS devices could fix it.
But this can not make sure that be well always, if occurs in the future. User need to reset network setting again.
Are there any brothers know or meet this phenomenon?
Thanks for your time to research this.
I have several macOS systems (Apple Silicon) running various flavours of macOS 26 (26.2 and 26.3 RC).
I also have a couple of Centos 10 Linux (ARM64) systems. All are connected to my 10 GbE switch, so not routers or anything else in the path that could mess with ECN flags. The network is dual stack.
The CentOS systems are configured to offer / accept ECN for both outgoing and incoming connections (net.ipv4.tcp_ecn = 1). The macOS systems have their default settings which also supposedly behave the same way:
$ sysctl -a | grep ecn
net.inet.tcp.ecn_timeout: 5
net.inet.tcp.ecn_setup_percentage: 100
net.inet.tcp.accurate_ecn: 0
net.inet.tcp.ecn_initiate_out: 1
net.inet.tcp.ecn: 1
net.inet.ipsec.ecn: 0
net.inet.mptcp.probecnt: 5
net.inet6.ipsec6.ecn: 0
net.classq.fq_codel.enable_ecn: 0
I have a simple throughput test program (written in C and using the standard socket API) that runs as both a client and a server which I have ported to both OS.
When I run it between the two Linux systems using either IPv4 or IPv6 a tcpdump / Wireshark trace shows that ENC is active in both directions. Internet Protocol / Differentiated Services shows Explicit Congestion Notification: ECN-Capable Transport code point '10' for both flows.
When I run the same test between one of the macOS systems and one of the Linux systems what I observe is that when using IPv4 the Linux -> macOS flow has Not ECN_capable Transport (0) while the macOS -> Linux flow has ECN-Capable Transport code point '10'.
This seems wrong. I even tried enabling LS4 (defaults write -g network_enable_l4s -bool true) but unsurprisingly this made no difference.
If I run the same test over IPv6 then both flows have ECN-Capable Transport code point '10'.
How can I ensure that macOS tries to negotiate ECN for outgoing IPv4 connections? Or is this a macOS bug?
Topic:
App & System Services
SubTopic:
Networking
Hi everyone,
I’m working with UDP Multicasting on iOS (iOS 15+) using Network.framework and facing a confusing issue.
Setup:
Multicast IP: 239.255.0.1
Port: 45454
Using NWConnectionGroup / NWMulticastGroup
NSLocalNetworkUsageDescription is present in Info.plist
Devices are on the same Wi-Fi network
Problem:
Receiving multicast packets works perfectly
Sending multicast packets does NOT work
No errors are thrown
send() completion handler reports success
stateUpdateHandler sometimes doesn’t transition to .ready
No packets are actually transmitted on the network
Observations:
The app can receive data from other multicast senders
Sending appears to be silently blocked
Reinstalling the app fixes the issue
This points to a Local Network permission problem
If permission was denied once, iOS does not re-prompt
Inbound multicast works, outbound multicast is blocked
Questions:
Is it expected on iOS that receiving multicast works even when sending is blocked?
Is reinstalling the app the only way to recover if Local Network permission was denied?
Is there any reliable runtime way to detect that outbound multicast is blocked?
Is NWConnectionGroup the correct and only supported way to send multicast on iOS?
Any clarification or official guidance would really help.
Thanks in advance!
Topic:
App & System Services
SubTopic:
Networking
I have to continuously disable Limit IP Tracking on my local Wi-Fi network. When it's enable I am not able to access some services on the same subnet that falls under rfc1918. Accessing remote network, over site to site vpn, is not affected, just my local network. I opened FB21483619 for this.
I would expect to see rfc1918 subnets not included. Also would expect all DNS queries to be sent to the servers provided in DHCP.
Topic:
App & System Services
SubTopic:
Networking
I'm using a Mac Studio in a homelab context and use Homebrew to manage the installed services. The services include things that access the local network, for example Prometheus which monitors some other servers, a reverse proxy which fronts other web services on the network, and a DNS server which can use another as upstream.
Local Network Access permissions make it impossible to reliably perform unattended updates of services because an updated binary requires a GUI login to grant local network permissions (again).
I use brew services to manage the services as launchd agents, i.e. they run in a non-root GUI context. I know that I can also use sudo brew services which instead installs the services as launchd daemons, but running services as root has negative security implication and generally doesn't look like a good idea to me.
If only there was a way to disable local network access checks altogether…
Currently in our app, to identify a network switch in device we are doing NEHotspotHelper.register and then NEHotspotHelperHandler block. When the command type is evaluate and if the network.didJustJoin, we are identifying it as a network switch.
As a part of moving our code base to iOS 26, if is found that NEHotspotHelper is deprecated. What is the proper replacement for this?
Topic:
App & System Services
SubTopic:
Networking