iOS11 error: Received XPC error Connection invalid for message type 3 kCFNetworkAgentXPCMessage

I have an app that works fine on iOS10 when used in conjunction with a per-app VPN connection, a device-wide VPN connection or no VPN connection. On iOS11, there are connection issues when used in conjunction with a per-app VPN connection (works fine with device-wide and no VPN). The app logs just show connection failure. The device console shows the following:


(CFNetwork)[318] <Error>: Received XPC error Connection invalid for message type 3 kCFNetworkAgentXPCMessageTypePACQuery


We also see errors like this:


iPhone iOSAppProxyProvider[258] <Notice>: void cfsocket_callback(CFSocketRef, CFSocketCallBackType, CFDataRef, const void *, void *):140 BYPASS: Socket Connection [<IP address>:443] failed due to error Operation timed out


Any suggestions to resolve this or anyway to generate additional debug information for these APIs?

Replies

On iOS 11, there are connection issues when used in conjunction with a per-app VPN connection (works fine with device-wide and no VPN).

Are you developing the per-app VPN solution yourself? Or using someone else’s?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

We are using someone else's. Our app is just subject to the commercial per-app VPN.

We are using someone else's.

You should escalate this via that product’s support channel. Any resolution to this issue will require a detailed analysis of their code and how it interacts with the OS, and they’re the only folks who can do that.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Sorry to revive such an ancient thread, but I just encountered the same thing in macOS. Presumably its the same as on iOS...


If you get errors like this in your log, but everything else seems to work OK:


(CFNetwork)[318] <Error>: Received XPC error Connection invalid for message type 3 kCFNetworkAgentXPCMessageTypePACQuery


Its failing because its trying to download the PAC file for proxy autodiscovery - possibly because your network doesn't support that. So turn off 'Automatic Proxy Discovery'.


On MacOS: System Preferences//Network/Wi-Fi/Advanced/Proxies. Uncheck the 'Auto Proxy Discovery' checkbox there


On iOS: Settings/Wi-Fi/; select the 'i' by the network you use; 'HTTP Proxy/Configure Proxy'. Set it to 'Off'


Once I'd done that (on my Mac) these irritating log messages stopped 🙂