iOS 16 network request failed on PacketTunnel

Hi, We have developed a VPN app, we recently received feedback from some iOS 16 users that VPN connections cannot be established, We found that PacketTunnel's network request fails, but requesting the same site in the main app works fine, the Wireless Data settings for the application are set to allow WLAN & Cellular Data. Network requests use NSURLSession.

After analysis, we think this may be a problem caused by network permissions on the App extension, and it returns to normal after restarting the phone.

Seems to only appear on Chinese version devices, iOS 16.0, iOS 16.0.2 versions have similar feedback.

Error log:

Error Domain=NSURLErrorDomain Code=-1009 "似乎已断开与互联网的连接。"

unsatisfied (Path was denied by NECP policy), interface: pdp_ip0[lte], ipv4, ipv6, expensive

ERROR: <PacketTunnelProvider:(454)> API request failed: Error Domain=NSURLErrorDomain Code=-1009 "似乎已断开与互联网的连接。" UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x1047674c0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_NSURLErrorNWPathKey=unsatisfied (Path was denied by NECP policy), interface: pdp_ip0[lte], ipv4, ipv6, expensive, _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <6602B486-A9E4-4B73-9D56-5BC4F49F5495>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <6602B486-A9E4-4B73-9D56-5BC4F49F5495>.<1>"
), NSLocalizedDescription=似乎已断开与互联网的连接。, NSErrorFailingURLStringKey=***, NSErrorFailingURLKey=***, _kCFStreamErrorDomainKey=1}

it returns to normal after restarting the phone.

That definitely suggests a bug in the OS. I recommend that you file it as such.

When you do this:

  1. Install the VPN (Network Extension) and Network Diagnostics configuration profiles from our Bug Reporting > Profiles and Logs page.

  2. Trigger a sysdiagnose log when you see the problem.

  3. Trigger another sysdiagnose log after the restart, when your provider is working again.

  4. Include both logs in your bug report, along with a rough timeline of the issue.

If you can’t reproduce this problem in-house, so you’re only seeing it from users in the field, then getting all that info is going to be challenge. If you have a particularly technical user seeing the problem, you could ask them to do all of this. If not, the most important thing is the sysdiagnose log in step 2.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks for your help, temporarily unable to reproduce this issue from our side. I have created a bug report, the bug number is FB11679354

same issue,my solution is update xcode 13.1 to 14.0.1 , My reproduction step is: use xcode13.1 packaged app to restore the network settings on the iOS 15.7+ mobile phone, the app will prompt that there is no network, the landlord also mentioned that it is only the mobile phone in China, this is also the case on my side, the same mobile phone can enter after hanging overseas vpn @mashroom @eskimo

同样的问题,我的解决方案是更新xcode 13.1到14.0.1,我的复现步骤是:用xcode13.1打包的app在ios15.7+的手机上还原网络设置之后,app进去就提示没有网络了,楼主也提到的了只是中国区的手机,这个我这边也是这样,同样的手机在挂海外的vpn后就可以进入 @mashroom @eskimo

iOS 16 network request failed on PacketTunnel
 
 
Q