Post not yet marked as solved
Hi,We occasionally get the subject error while downloading using NSURLSession. We set 60 seconds to the NSURLSessionConfiguration.timeoutIntervalForRequest property. But, we get the error in from 12 to 20 seconds. When a response doesn't come for more than 60 seconds, we get another error with _kCFStreamErrorCodeKey=-2102.I couldn't locate definitions of _kCFStreamErrorCodeKey in headers. Can someone let me know what the error code key is and what the value 60 means?Thank you,sukeza
Post not yet marked as solved
Hi guys.This might be a dumb question but I am going to ask it anyways.I just started learning swift and have a ways to go. I have been looking to see if there is a simple ping command in swift on a mac app?I have been looking but can not seem to find information about this. For exaple, pinging gooogleThank you in advance and sorry ifthis is a dumb question.
Post not yet marked as solved
We're proving a free *****-access WiFi network. • Users select the WiFi hotpsot in Settings > WiFi• Captive Network Assistant tear sheet pops up• Users log-in via the Captive Network Assistant and are authenticated• Users can click "Done" button top-right of the CNA tear sheet to close it - or Users can click on the captive portal content to view web pagesWhat we'd like - and we have seen this before - is to open any web content in Safari rather than in the CNA micro-browser in the tear sheet.It used to be the case that if one provided a full URL as a link, once the CNA was connected [eg. you see the "Done" button top-right] clicking in this link would open web content up in Safari.Now this functionality seems deprectated. This is a major issue as it means once users are logged-in we cannot offer them links to other areas of the capitve portal, such as news or service updates. They're just dropped back into Settings > WiFi and would then need to manually boot Safari and visit more pages. Not a great user experience.Any ideas? Seems like there are quite a few threads on this but with no definitive answers from Apple.
Does CFNetwork provide API to open a socket on a particular interface? This post suggestsusing SCNetworkInterfaceCopyAll and SCNetworkInterfaceGetInterfaceType to find an interface with a desired type. But I get an error saying SCNetworkInterfaceCopyAll is unavailable in Xcode 8.3.2.If SCNetworkInterfaceCopyAll is unavailable, how would you search the result of getifaddrs to find an interface with a type (e.g. kSCNetworkInterfaceTypeIEEE80211 (wifi) vs kSCNetworkInterfaceTypeWWAN (cell)).Thanks!
Post marked as Apple Recommended
Hi,We are getting background crash in CFNetwork with tubemanager internal class. I have provided crashed thread and full log below. Could you please suggest solution to this crash.Thread 2 name:Thread 2 Crashed:0 CFNetwork 0x00000001825119e0 CFAllocatedReferenceCountedObject::_retainable_hash(void const*) + 0 (CFObject.cpp:204)1 CoreFoundation 0x0000000181d26fb8 CFBasicHashFindBucket + 164 (CFBasicHash.c:426)2 CoreFoundation 0x0000000181d26ec0 CFDictionaryGetValue + 160 (CFDictionary.c:416)3 CFNetwork 0x000000018253f3dc TubeManager::_onqueue_enqueueRequestForProtocol(MetaConnectionCacheClient*, HTTPRequestMessage const*, MetaConnectionOptions, BaseAwaitingTube*) + 80 (CFObject.h:712)4 CFNetwork 0x00000001825402f4 TubeManager::_onqueue_reenqueueAwaitingTube(BaseAwaitingTube*) + 112 (TubeManager.cpp:447)5 CFNetwork 0x0000000182540378 ___ZN11TubeManager21_onqueue_newTubeReadyEP4Tube13CFStreamError_block_invoke + 28 (TubeManager.cpp:662)6 libdispatch.dylib 0x0000000180cdd1c0 _dispatch_client_callout + 16 (object.m:455)7 libdispatch.dylib 0x0000000180ce8b24 _dispatch_block_invoke_direct + 376 (queue.c:2872)8 CFNetwork 0x000000018266ee98 RunloopBlockContext::_invoke_block(void const*, void*) + 36 (CoreSchedulingSet.mm:361)9 CoreFoundation 0x0000000181d2d9a8 CFArrayApplyFunction + 68 (CFArray.c:650)10 CFNetwork 0x000000018266ed7c RunloopBlockContext::perform() + 136 (CoreSchedulingSet.mm:315)11 CFNetwork 0x00000001826700a4 MultiplexerSource::perform() + 312 (CFNRunLoopMultiplexer.c:282)12 CFNetwork 0x000000018266fe10 MultiplexerSource::_perform(void*) + 64 (CFNRunLoopMultiplexer.c:47)13 CoreFoundation 0x0000000181e02278 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1943)14 CoreFoundation 0x0000000181e01bc0 __CFRunLoopDoSources0 + 524 (CFRunLoop.c:1989)15 CoreFoundation 0x0000000181dff7c0 __CFRunLoopRun + 804 (CFRunLoop.c:2821)16 CoreFoundation 0x0000000181d2e048 CFRunLoopRunSpecific + 444 (CFRunLoop.c:3113)17 CFNetwork 0x000000018251bcec +[NSURLConnection(Loader) _resourceLoadLoop:] + 336 (NSURLConnection.mm:364)18 Foundation 0x000000018293a50c __NSThread__start__ + 1024 (NSThread.m:1163)19 libsystem_pthread.dylib 0x0000000180ee7860 _pthread_body + 240 (pthread.c:697)20 libsystem_pthread.dylib 0x0000000180ee7770 _pthread_start + 284 (pthread.c:744)21 libsystem_pthread.dylib 0x0000000180ee4dbc thread_start + 4https://mcafee.box.com/s/tdyjymvudfakt7k1nzszf7lpy9o6tr74
Post not yet marked as solved
When I install the thunderbolt Ethernet adapter with it connected to a switch the switch shows the gigabit connection with the LEDs but the MacBook doesn't show the connection as being active. Looking at the Mac under System I see Thunderbolt 1 and 2 as being inactive. OS is 10.12.6 Beta and HW is MacBook Pro Retina 15 inch Mid 2015 Any ideas?
Post not yet marked as solved
Hey,I want to get nearby Wi-Fi network's SSID into the app using network extension framework.Right now I can get scan list by visiting the setting--->Wifi Screen but I want to get those Scan Result into the app without visiting the setting wifi screen.If anyone idea about it please let me know
Post not yet marked as solved
Hi All,I am developing the application to communicate with udp based wifi devices.But all the devices are connected with my office network.My ipad also connected with my office network.Now i want to list the available deivces in the same network in inside my application.How can i acheive it? .Thanks in advance.
Post not yet marked as solved
I am Looking for a list of user agent strings by device (not browser, etc).For example, a user string of "Apple-iPad3C4/" is an iPad, 4th generation, WiFi only.An iPhone 6 Plus CDMA would be an "Apple-iPhone7C1/"And so on.I am looking for a list of all iOS products with their agent strings. Does such a thing exist anywere?Thanks for any help you can provide.
Post not yet marked as solved
I'm trying to use URLProtocol for implementing JWT authentication.The authentication flow would look like this:A request ist sent to the server. If the server returns 401 (WWW-Authenticate: Bearer realm="example.com"') the user needs to provide his credentials. With those credentials a request to the authentication server will return a valid access token. This access token is then used for the original request by setting a custom header.There are multiple issues I'm facing:didReceive challenge: URLAuthenticationChallenge, completionHandler is not called with Bearer authenticateioninside didReceive challenge: URLAuthenticationChallenge, completionHandler I don't find any way to append the header to the original requestif the user takes longer to provide his credentials than the timeout of the original request, the request would run into an timeoutIs seems that there is no way to use URLProtocol for handling token based authentication, is it?Is there any alternative suggested way to handle bearer authentication without using frameworks like Alamofire or Moya?
Post not yet marked as solved
When building an app, is it possible or restrict or prohibit all network access for the app at the permission level? I am using React Native with hundreds of npm modules, and I want to ensure there is no data leakage from my app. It does not need internet access, so I would like to shut down all access, period.
Post not yet marked as solved
As suggested earlier in https://forums.developer.apple.com/thread/76987 opening a new thread.We are experiencing a CFNetwork TCPIOConnection::_handleTLSEvent crash. Full crash report here: https://gist.github.com/jarosan/af09485be31123bb6ebb9395ba9382f8Thanks in advance!
Post not yet marked as solved
Hi, I am working on a VPN app that use NEPacketTunnelProvider, the app has a Today Extension that allow me to control the VPN connection, start and stop the connection. I am able to load the NEVPNManager from Preferences in Today Extension, which is created in the Host app, and I am able to start the tunnel using this NEVPNManager.Everything is going well.But when I make some changes to this loaded NEVPNManager in Today Extension, for example:manager.isOnDemandEnabled = trueand try to save the manager, I got the following error:-[NEVPNManager saveToPreferenc:337 Failed to save configuration: Error Domain=NEVPNErrorDomain Code=1 "configuration type is wrong" UserInfo={NSLocalizedDescription=configuration type is wrong}I am pretty sure that the configuration is valid, at least the same code works in the Host app. And if I remove the above changes (modify properties, save to preferences), the code also works in Today Extension, which means I can start the vpn tunnel normally in Today Extension.So my question is, can I change the properties of NEVPNManager in Today Extension instead of the Host app, and save the changes to preferences, so that changes will take effect next time I start the tunnel? And how? if it's possible.Thanks!
Post not yet marked as solved
Now I'm working on developing iOS application which need the function of FTP client.And I'm looking for an available OSS(Library) of FTP client but couldn't find good one.Now I'm implementing the application with Swift4(XCode9.2, iOS11SDK)My requirements for the OSS are below:Support passive mode, FTPS, port select, make/remove folder, SSL Implicit mode(optional)Avoid deprecated API as far as possibleCurrently maintainedMIT or BSD LicenseIf you know other recommended FTP client OSS for iOS, please let me know.I'd appreciate if you would provide me helpful information.So far I've found the following OSS.[GoldRaccoon]<https://github.com/albertodebortoli/GoldRaccoon>I've tested FTP file upload with sample Application and it succeeded.No update for nearly 4 years.Has Deprecated API such as `CFWriteStreamCreateWithFTPURL`[rebekka]<https://github.com/Constantine-Fry/rebekka>Written in Swift2Has Deprecated API such as `CFWriteStreamCreateWithFTPURL`I'm working on building for this OSS with Xcode9.2(Swift4). But it doesn't yet.[FileProvider]<https://github.com/amosavian/FileProvider>Written in Swift4 and maintained even now. But no sample application.I'm trying to create test application for this OSS. But it doesn't work yet.
Hey Apple devs,Has anyone encountered ping spikes on macOS when using WiFi? When you run a constant ping, it looks like this…64 bytes from 192.168.0.30: icmp_seq=502 ttl=128 time=1.443 ms64 bytes from 192.168.0.30: icmp_seq=503 ttl=128 time=3.007 ms64 bytes from 192.168.0.30: icmp_seq=504 ttl=128 time=1.684 ms64 bytes from 192.168.0.30: icmp_seq=505 ttl=128 time=186.861 ms64 bytes from 192.168.0.30: icmp_seq=506 ttl=128 time=69.545 ms64 bytes from 192.168.0.30: icmp_seq=507 ttl=128 time=141.434 ms64 bytes from 192.168.0.30: icmp_seq=508 ttl=128 time=24.043 ms64 bytes from 192.168.0.30: icmp_seq=509 ttl=128 time=2.961 ms64 bytes from 192.168.0.30: icmp_seq=510 ttl=128 time=1.827 ms64 bytes from 192.168.0.30: icmp_seq=511 ttl=128 time=1.171 msSeems to happen reliably when you open the WiFi menu bar on High Sierra. Other apps can cause this too.I think others are seeing this issue too (especially gamers):https://apple.stackexchange.com/questions/263638/macbook-pro-experiencing-ping-spikes-to-local-routerAs well as games, real time network apps like Synergy suffer too:https://symless.com/help/mac-wifi-lagCheers,Nick
Post not yet marked as solved
I am trying to connect wpa2 enterprise wifi using iPhone app programmatically.before that I tried connecting to that wifi manually:From Settings in iPhone deviceUsed these three parameters SSID, Username, passwordAfter that it ask to trust the certificate and trusting the certificate, the wifi get connect, Done!Now I am trying to connect wifi programmatically using following code:NEHotspotEAPSettings *settings = [[NEHotspotEAPSettings alloc]init];
settings.password = self.password.text;
settings.username = self.username.text;
settings.supportedEAPTypes = [NSArray arrayWithObjects:[NSNumber numberWithInteger:NEHotspotConfigurationEAPTypeEAPPEAP], nil];
NEHotspotConfiguration *configuration = [[NEHotspotConfiguration alloc]initWithSSID:self.ssid.text eapSettings:settings];
[[NEHotspotConfigurationManager sharedManager]applyConfiguration:configuration completionHandler:^(NSError * _Nullable error) {
if (error) {
NSLog(@"Error: %@",error.localizedDescription); }
else { NSLog(@“Connected”); }
}];but this code gives an errorInvalid EAP settings : NEHotspotConfiguration EAP settings must have either trusted server certificates or trusted server names configuredSince I don’t have any trusted server certificate or trusted server name. What should I set in the **** property of NEHotspotEAPSettings (passing nil also gives me same error)settings.trustedServerNamesPlease help to solve this. Thanks!
Post not yet marked as solved
I`m trying to make my own OpenVPN client using NetworkExtension. I'm following these instructions:https://github.com/ss-abramchuk/OpenVPNAdapterBut I cant get it to work. I create my manager succesfully, without any errors. But then when I call startTunnel() nothing happens. No error (I have my try/catch in place) and nothing in the log. I have the NetworkExtension entitlements in both my targets. This is the code in question:NETunnelProviderManager.loadAllFromPreferences { (managers, error) in
guard error == nil else {
NSLog("Unexpected error: \(error).");
return
}
/
if (managers?.count != 0)
{
do
{
NSLog("Found VPN with target \(managers?[0].localizedDescription)")
managers?[0].isEnabled = true;
try managers?[0].connection.startVPNTunnel();
}
catch
{
NSLog("Unexpected error: \(error).");
}
}
/
else
{
NSLog("Not found, creating new");
let manager = NETunnelProviderManager();
/
guard
let configurationFileURL = Bundle.main.url(forResource: "config", withExtension: "ovpn"),
let configurationFileContent = try? Data(contentsOf: configurationFileURL)
else {
fatalError()
}
let tunnelProtocol = NETunnelProviderProtocol()
tunnelProtocol.serverAddress = ""
tunnelProtocol.providerBundleIdentifier = "com.vpn.***.TunnelManager";
tunnelProtocol.providerConfiguration = ["ovpn": configurationFileContent]
manager.protocolConfiguration = tunnelProtocol
manager.localizedDescription = "My VPN"
manager.isEnabled = true
/
manager.saveToPreferences(completionHandler: { (error) in
if let error = error {
print(error);
}
manager.loadFromPreferences(completionHandler: {(error) in
do
{
try manager.connection.startVPNTunnel();
}
catch
{
NSLog("Unexpected error: \(error).");
}
})
});
}I changed the blunde identifier for privacy reasons.I hope somebody can help me with my problem, if you need the contents of another file, or any other information, please ask.Thanks in advance.
Post not yet marked as solved
How do we pass launchd socket to NWListener or there is other ways to integrate ?If CFSocket to be deprecated, what are the alternatives for launchd daemons ?
Post not yet marked as solved
Hi!We have found a lib system_kernel.dylib (os_channel_flow_admissible) crash since iOS11 and later.This bug is not highly reproducible but affects a large group of our users. You can find a stack trace below:#4. Crashed: com.apple.network.connections
0 libsystem_kernel.dylib 0x182ec3a60 os_channel_flow_admissible + 6
1 libsystem_network.dylib 0x182f47da0 nw_channel_check_flows_allowed + 124
2 libdispatch.dylib 0x182d34a60 _dispatch_client_callout + 16
3 libdispatch.dylib 0x182d3ce94 _dispatch_continuation_pop$VARIANT$mp + 424
4 libdispatch.dylib 0x182d46784 _dispatch_source_invoke$VARIANT$mp + 1364
5 libdispatch.dylib 0x182d3e86c _dispatch_queue_serial_drain$VARIANT$mp + 280
6 libdispatch.dylib 0x182d3f2fc _dispatch_queue_invoke$VARIANT$mp + 336
7 libdispatch.dylib 0x182d3fcc8 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 340
8 libdispatch.dylib 0x182d48098 _dispatch_workloop_worker_thread$VARIANT$mp + 668
9 libsystem_pthread.dylib 0x183067e70 _pthread_wqthread + 860
10 libsystem_pthread.dylib 0x183067b08 start_wqthread + 4Is it a known issue? How can we fix it?Thanks!
I am attemtping to establish a tcp connection with a MacOS per-app vpn client to a tunnel_server similar to the one provided in the SimpleTunnel example. I have already converted the tunnel_server code to Swift 3 and believe it works. I ran it (./tunnel_server 8889 tunnel_server/config.plist) on terminal and got the following:2018-08-06 14:37:40.883 tunnel_server[86851:3286192] Starting network service on port 88892018-08-06 14:37:41.642 tunnel_server[86851:3286192] Network service published successfullyHowever I am still unable to connect my per-app vpn to the server. I believe it might have to do with the "EndAddress" and "StartAddress" in the config.plist for the tunnel_server and the remote address to which my per app vpn is trying to connect to.Should I be using the default "EndAddress" and "StartAddress" Config.plist values provided in the SimpleTunnel example or should it be something else? (Currently using default values provided in example code)Does the port number matter? (Im currently using 8889 when I run on terminal).And in terms of my per app vpn configuration server address value, should it match either the "EndAddress" or the "StartAddress" along with a colon and port number? (ex: deafultIPAddress:8889)