Hi,
We are developing an app using PacketTunnelProvider from Network Extension framework. It is packaged as a system extension.
We are trying to implement an "always-on" functionality, but cannot manage to start the extension before user login, with or without on-demand enabled.
However we see in other posts (1, 2) that a network extension packaged as sysex should automatically start before user login.
Are we missing something? Is it a limitation of PacketTunnelProvider?
Thanks
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
I want to configure one aspect of my networking configuration (the QUIC keepalive interval). This only seems to be configurable via Network.framework’s nw_quic_set_keepalive_interval. Is there any way to apply this to a URLSession? Or do I need to implement the whole connection management myself using Network.framework?
Note that AsyncDNSResolver is a fairly new Apple sponsored framework (search for it).
I am trying to resolve a hostname (behind a CNAME) but cannot. In face even "ping" in mac Terminal can't.
The host I start with is apidev.leaptodigital.com - when I ask for its CNAME:
resolver.queryCNAME(name: "apidev.leaptodigital.com")
I get:
salespro-dev-server-2.eba-uxpxmksr.us-east-1.elasticbeanstalk.com
Great! But nothing I try with that hostname returns an IP address. I tried queryCNAME again, then queryA, then queryAAAA.
Yet I can send http traffic to this host, so its getting resolved somewhere.
Note that nslookup in Terminal finds it just fine.
David
PS: tried older APIs like CFHostStartInfoResolution but they don't return anything either. Did not try getHostName as its use is discouraged.
Topic:
App & System Services
SubTopic:
Networking
NEFilterManager.shared().loadFromPreferences { loadError in
DispatchQueue.global.async {
...
}
}
the code above is executed in an app-like deamon and completionHandler was never invoked, same code in an application works fine.(they are both packed with content filter network system extension)
is it because of the restriction of app-like deamon?
We have a requirement to create a production quality application that also acts as HTTPS server for certain communication.
The preference is for the server to support HTTP/1.1, HTTP/2 and HTTP/3 communication asynchronously, though not mandatory to support all the HTTP versions. Wanted to get the guidance, on which stack should be used, that is most reliable and that gives the maximum long term compatibility, sustainability and reliability.
What is the recommended 'in-built' or 'available by default' stack on Apple Platform ?
For HTTPS on HTTP/1.1 with synchronous mode operations ?
For HTTPS on HTTP/1.1 with asynchronous mode operations ?
For HTTPS on HTTP/2 with synchronous mode operations ?
For HTTPS on HTTP/2 with asynchronous mode operations ?
For HTTPS on HTTP/3 with asynchronous mode operations ?
For HTTPS on HTTP/1.1 + HTTP/2 with synchronous mode operations ?
For HTTPS on HTTP/1.1 + HTTP/2 with asynchronous mode operations ?
For HTTPS on HTTP/1.1 + HTTP/2 + HTTP/3 with asynchronous mode operations ?
What the generally recommended server stack that a typical application uses whether 'in-built' or 'available by default on Apple ' or 'not-available by default on Apple' stack.
From the available stacks , we tried to evaluate the below stacks:
https://opensource.apple.com/projects/swiftnio/ : We understand that while it’s not preinstalled as part of Apple's OSes, it is an official Swift package supported by Apple and can easily be added to your project. At the moment it supports HTTP/1.1 and HTTP/2. The link https://github.com/apple/swift-nio/issues/1730says that HTTP/3 will get added in the future.
Is there any other HTTPS stack (built-in or third-party) that is recommended to the used on Apple's platform ? Our application is expected to be working on macOS, iOS, iPadOS, tvOS and watchOS.
We understand that macOS also includes Apache HTTPD server. As our application is not primarily a Web Server (and also supports other protocols both in client and server mode), it looks integrating HTTPS directly into the application using a lightweight HTTP library with SSL/TLS support is a better option, in place of Apache HTTPD.
From the document we know that swift-nio uses BoringSSL (swift-nio-ssl) which is prepackaged along with the swift-nio library, and it does not use the default Secure Transport. What is the reason being not using Secure Transport ? Now does it become the responsibility of the application using swift-nio to take care of updating BoringSSL with the patches.
In my case there are three interfaces. I had a mental model that I now believe is incorrect.
If any of the 3 interfaces is "satisfied", then I get one message telling me so. I guess if that one interface goes down, then I should get a second message that tells me that (this is hard to test as Xcode keeps disconnecting from my device when I switch to Settings to change things).
in my case, wifi and cellular are both on. I launch the app, get notified that wifi is satisfied, but nothing on cellular.
So my guess is there is a hierarchy: wired, wifi, and cellular. If the highest priority path is available, the others are assumed "off" since you have a path. Thus, you will never get "satisfied" for more than one path.
Correct?
We have an app which is using CTSubscriber.simInserted (using the carrier entitlement com.apple.CommCenter.fine-grained).
In iOS 18, simInserted returns false for every sim (where it should instead be returning true).
Presumably this just is a temporary bug in 18 beta?
Case-ID: 10969723
(Due to privacy concerns, I have hidden part of the URL and included the complete plain text in the email demo project with Case-ID: 10969723)
After our game was launched in Japan, a small number of Japanese users reported that they were unable to enter the game. After our investigation, we confirmed that the request under the yfy-api-oversea.xxxxxxxxxxxxxx.com domain name failed.
iOS NSURLSession API returns the following error:
Error Domain=NSURLErrorDomain Code=-1000 "無効なURL" UserInfo={_kCFStreamErrorCodeKey=22, NSUnderlyingError=0x3019e8030 {Error Domain=kCFErrorDomainCFNetwork Code=-1000 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0[802.11], ipv4, ipv6, dns, proxy, uses wifi, _kCFStreamErrorCodeKey=22, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<7>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<7>"
), NSLocalizedDescription=無効なURL, NSErrorFailingURLStringKey=https://yfy-api-oversea.xxxxxxxxxxxxxx.com/init/info?channel_code=jpxxxxxxxxxxxxxxios×tamp=1735012505&sign=1617e4cf88b58df2aa90a6b3985a8ac2&game_code=XXXXX, NSErrorFailingURLKey=https://yfy-api-oversea.xxxxxxxxxxxxxx.com/init/info?channel_code=jpxxxxxxxxxxxxxxios×tamp=1735012505&sign=1617e4cf88b58df2aa90a6b3985a8ac2&game_code=XXXXX, _kCFStreamErrorDomainKey=1}。
We have tried various methods but cannot reproduce this error (Code=-1000).
I can provide the following clues:
1、We have checked the server and confirmed that the request did not reach the server, but was intercepted by the iOS client and was not sent.
2、This problem does not seem to have much to do with the iOS system version. The system versions where the problem occurred are widely distributed: 17.2.1、17.7.1、17.5.1、17.6.1、17.7、18.0.1、18.1、18.1.1 e.g.
3、This problem seems to have nothing to do with the device model. The following models have experienced problems: iPhone16、iPhone 16 Pro、iPhone 14、iPhone 14 Plus、iPhone 14 Pro Max、iPhone 13、iPhone11 e.g.
4、By tracking the logs, some users who encountered the problem later recovered and the problem did not occur again(The user IP and iOS system restored by yourself have not changed). However, this problem persists for some users. Even if the iOS system is upgraded to the latest version, there are still problems.
5、The following two IPs are the IPs of users who encountered this problem (1.73.13.210, 153.252.131.136). But this problem seems to have nothing to do with IP. For some users who restored themselves, their IPs did not change, but the problem no longer occurred.
6、This problem seems to only occur in Japan. Mainland China, Taiwan, and Hong Kong have never encountered this situation.
7、It doesn't seem to have anything to do with GET requests. Another login request(https://yfy-api-oversea.xxxxxxxxxxxxxx.com/login/c/place)uses a POST request and will also encounter this error.
8、I wonder if it has something to do with the two symbol "-" in the domain name?
I checked Apple documentation and searched online, but couldn't find any more information. This problem cannot be reproduced either. Only technical requests can be initiated.
I provided a demo project(see email for Case-ID: 10969723)
Thanks.
I'm writing an LDAP Browser app using SwiftUI. I tested my LDAP code using a command line app that uses the exact same libraries and it successfully connects to my LDAP server over a TLS connection. I did need to install the CA cert into the system keychain.
The SwiftUI version, using the exact same code and parameters returns an "Unknown CA" error. It works fine without TLS. Can anyone explain why certificate validation is different for a GUI app?
Topic:
App & System Services
SubTopic:
Networking
Hi ,
I want to obtain detailed information about the cellular network. Please guide me on how I can access these values. If there are any partnership programs available for this, I am ready to participate
1. cell identity
2. Lcellid
3. ratType
4. enb
5. snr
6. ARFCN
7. TA
8. cqi
9. signalStrength (RSSI)
10. tac (Tracking area code)
11. BSIC
12. lac id
13. MCC code (Restricted on some devices)
14. MNC code
15. PSC (Primary Scrambling code)
16. Arbitrary Signal Strength (ASU)
17. BER
18. RSSI
19. Signal Quality
We are checking for cellular mode using the code below.
When the code below is executed, is it correct to convey the status value of the actually connected cellular environment?
Sometimes HSDPA or WCDMA is output.
I would like to inquire under what conditions the value is output.
[Code]
func getCellularConnectionType() -&gt; String {
if #available(iOS 14.1, *) {
if let radioAccessTechnology = networkInfo.serviceCurrentRadioAccessTechnology?.values.first {
Debug.log("Radio Access Technology: (radioAccessTechnology)")
switch radioAccessTechnology {
case CTRadioAccessTechnologyLTE:
return "LTE"
case CTRadioAccessTechnologyNRNSA:
return "5G-NSA"
case CTRadioAccessTechnologyNR:
return "5G-SA"
default:
return "ETC"
}
}
}
return "Cellular"
}
I am developing an Xcode app with a job feed, with profile view, with chat eg. I fetch using federatet queries to my microservices thru Apollo Router. Infront of the Apollo Router i Have a Kong that adds a X user ID, that the microservices use for personalized feed and other user info. The info is stored with SwiftData. My thought is that i should add a better way of controlling when i need to fetch. I have a “lastupdateAPI” with different entities (profile, profile picture eg). So when nothing has changed we do not fetch. But rather then using a own API for this, isnt ETag better? Or is it any other recommendations with Xcode Swiftui. Good strategies for not fetching what i already have?
Topic:
App & System Services
SubTopic:
Networking
I have an app that tracks Wi-Fi and Cellular data usage. Many users want to see tracking per sim, and I can't find a way to achieve that. It seems like iOS reports data usage from every sim into pdp_ip0 interface.
Is there any place to look into?
Hi all,
I'm struggling to identify the cause of a really strange issue that has started to plague our network of Mac devices. We use Cisco switches and have port security turned on which means any device that registers more than one MAC address triggers a port violation which then shuts down the port for a short period of time (5 mins I believe).
A few months ago we suddenly started get lots of violations from Mac devices the were all registering additional MAC addresses (2 usually) that all had the same 6 character prefix (00:00:40).
So far we've not been able to determine the cause and now getting pretty desperate and exploring all possible avenues.
All we know id that prefix is registered to a company called Applicon from back in the day but is now shut down.
Has anyone come across this issue or know of any possible reason why this may be happening?
Thanks
Topic:
App & System Services
SubTopic:
Networking
Hi Team
We are facing a problem in our app for one particular user the url session is giving below error. Rest for all the users its working fine. Below is the complete error we get from user device.
{"type":"video_player","error":"Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorFailingURLStringKey=https://api.vimeo.com/videos/1020892798, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<4>, _NSURLErrorRelatedURLSessionTaskErrorKey=(\n "LocalDataTask .<4>"\n), NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://api.vimeo.com/videos/1020892798, NSUnderlyingError=0x301ea8930 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9836, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9836, _NSURLErrorNWPathKey=satisfied (Path is satisfied), viable, interface: pdp_ip0, ipv6, dns, expensive, uses cell}}, _kCFStreamErrorCodeKey=-9836}"}
Device info
device_type iOS
device_os_version 18.1.1
device_model iPhone 11
Please let me know how we can resolve for one particular user. Or what we can adivse.
Hello,
A quick background:
I am developing an App that receives a data stream from a device through its Wi-Fi network. The device itself is not connected to the internet, so the app won't be either.
Now, I am adding a new feature to the App that would require internet connection during the data stream. Consequently, my users would need to use their cellular data.
On later versions of iPhone, the phone would occasionally detect the lack of internet connection and asks the user via a pop-up if they want to use their cellular data. However, this behavior is not consistent.
So my question is- can we programmatically invoke this pop-up so the user can connect to the internet?
Or even better- can we program the App to use cellular data while still being connected to a Wi-Fi network?
Note:
I have seen mixed answers on the internet whether this is doable or not, and I know that users are able do it themselves by manually configuring their IP in their WiFi settings page, but I doubt this operation can be done through the App for security reasons.
Thanks!
I have a single ssid that I would like to connect users to, which I can do easily with the NetworkExtension api.
The only additional feature I want to add is being able to detect the availability of the ssid before connecting to it.
I have checked the forums and looked through things like the Hotspot Helper Docs.
From what I can tell, this just isn't possible. So, two questions I have:
Is this definitely impossible?
Any recommended alternatives for simulating this type of behavior?
Thanks!
Topic:
App & System Services
SubTopic:
Networking
Hello. I'm developing on a cross-platform app to help user connect enterprise network and found it difficult in macOS.
The issue is, I guided user to install profile, but the authentication won't start immediately even the cable is plugged in or the WLAN is connected. There is still some manual operation to be done:
Ethernet: Select the correct profile, and click the Connect button.
Wlan: Click the Connect button. (The profile contains SSID so need't select the correct profile)
Obviously, the operation is still not easy for users to understand and follow. So, is there any method to auto connect 802.1x network using the selected profile in terminal or by code? I mean, the manual operation is not necessary, maybe you can tell me a better solution.
BTW, I found it possible to connect WLAN and auto select the correct profile by using this command
networksetup -setairportnetwork en1 MY_SSID, but it could be very slow since the authentication seemed start 30 sec after connecting the SSID. So I believe it not the best solution.
Hi Everyone,
I’m working on a communication system for my app using NWConnection with the UDP protocol. The connection is registered to a custom serial dispatch queue. However, I’m trying to understand what the behavior will be in a scenario where the connection is canceled while there are still pending receive operations in progress.
Scenario Overview:
The sender is transmitting n = 100 packets to the receiver, out of which 40 packets have already been sent (i.e., delivered to the Receiver).
The receiver has posted m = 20 pending receive operations, where each receive operation is responsible for handling one packet.
The receiver has already successfully processed x = 10 packets.
At the time of cancellation, the receiver’s buffer still holds m = 20 packets that are pending for processing, and k = 10 pending receive callbacks are in the dispatch queue, waiting to be executed.
At same time when the 10th packet was processed another thread triggers .cancel() on this accepted NWConnection (on the receiver side), I need to understand the impact on the pending receive operations and their associated callbacks.
My Questions:
What happens to the k = 10 pending receive callbacks that are in the dispatch queue waiting to be triggered when the connection is canceled? Will these callbacks complete successfully and process the data? Or, because the connection is canceled, will they complete with failure?
What happens to the remaining pending receive operations that were initiated but have not yet been scheduled in the dispatch queue? For the pending receive operations that were already initiated (i.e., the network stack is waiting to receive the data, but the callback hasn’t been scheduled yet), will they fail immediately when the connection is canceled? Or is there any chance that the framework might still process these receives before the cancellation fully takes effect?
I am trying to programmatically block some egress and ingress connections using bsd packet filters. My program writes rules in a file and this file is loaded using an anchor in /etc/pf.conf (main ruleset) . Rules work as intended. But when there is network change like turn on/off wifi , and change in wifi nw the main ruleset is getting flushed and i have to reapply (pfctl -q -f /etc/pf.conf) to get the rules back in place.
Looking for guidance to keep the main ruleset intact irrespective of system changes.