`URLSessionConfiguration.connectionProxyDictionary` Fails to Disable HTTP(s) Proxy on iOS 26.x

Our business interface requests require disabling HTTP(s) proxies. We configured URLSessionConfiguration.connectionProxyDictionary as before, but found that it does not work on iOS 26

1.Core code:

	let configuration = URLSessionConfiguration.default
	       configuration.connectionProxyDictionary = [
	            "HTTPEnable": false,
	            "HTTPSEnable": false,
	            "SOCKSEnable": false,
	        ]
	        let session = URLSession(configuration: configuration)
	        let request = URLRequest(url: URL(string: "https://www.baidu.com")!,timeoutInterval: Double.infinity)
	        // 发送请求
	        let task = session.dataTask(with: request) { data, response, error in
	            if let error = error {
	                print("网络请求失败: \(error)")
	            }
	            if let data = data {
	                print("网络请求成功,返回数据长度: \(data.count)")
	                if let responseString = String(data: data, encoding: .utf8) {
	                    print("返回数据: \(responseString.prefix(100))...")
	                }
	            }
	        }
	        task.resume()

2.Specific steps:

We captured traffic using Proxyman and Charles. With the same code, requests cannot be captured on iOS 18 and iOS 16.1, but can be captured on iOS 26.2 and 26.1.

Conclusion:Therefore, we suspect there is a bug with URLSessionConfiguration.connectionProxyDictionary on iOS 26.x. Please let us know whether this is a bug. If not, how should we properly disable HTTP(s) proxies?

Note: We need to exclude PAC proxies, which are commonly used in corporate internal networks.

3.Devices & Software

  • Xcode 16.4
  • iPhone 26.2、Simulator 26.1
  • iPhone 16、Simulator 18.0、Simulator 18.6
  • Proxyman、Charles

Given that this works on iOS 18 and fails on iOS 26, you should definitely file a bug about it.

Please post your bug number, just for the record.

As to what you can do about it right now, I have one quick suggestion: Toggle the usesClassicLoadingMode property. That is:

  • usesClassicLoadingMode defaults to true. If your code is currently setting it to false, remove that code.
  • If your code is not currently setting usesClassicLoadingMode at all, or setting it to true, try setting it to false.

Honestly, I don’t think that’ll help, but it’s easy test to run so I’m gonna recommend that you run it now just in case. Please reply back here with your results.

If, as I suspect, this doesn’t change things, we can then talk about other potential paths forward.

Share and Enjoy

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

Thank you for your reply.

I have tried toggling the usesClassicLoadingMode property as true, but it does not work. The issue still persists on iOS 16.2 and 16.3.1.

Thank you for your reply.

I have tried toggling the usesClassicLoadingMode property as suggested, but it does not work. The issue still persists on iOS 26

Thanks for checking. And, yeah, it was a long shot.

Earlier I wrote:

you should definitely file a bug about it.

Did you do that? What was the bug number?


Also, I’d like to get more context on why you need to do this? Most folks using URLSession want to use the default proxy configuration because, if they don’t, then their app fails for that fraction of users who can only access the network via a proxy. So I’m curious why it’s important that you disable the proxy, even though it means that your app won’t work for those users.

Share and Enjoy

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

`URLSessionConfiguration.connectionProxyDictionary` Fails to Disable HTTP(s) Proxy on iOS 26.x
 
 
Q