How-to

How to Configure iOS App Transport Security (ATS) Exceptions

App Transport Security (ATS) is Apple's default networking policy for iOS, iPadOS, and macOS apps: by default, it requires TLS 1.2 or later, forward-secrecy-capable cipher suites, and a certificate signed with sufficiently strong keys and hashes for essentially all network connections your app makes. If a server you connect to doesn't meet that bar, the connection fails outright rather than falling back to something weaker — which is the whole point, but it does mean you sometimes need to declare an explicit, scoped exception rather than fight the default.

Where exceptions are configured

ATS settings live in your app's Info.plist under the NSAppTransportSecurity dictionary key. Two very different things live under that same key, and conflating them is the most common mistake:

Per-domain exceptions under NSExceptionDomains are almost always the right tool, even when the underlying reason feels like it applies "everywhere" — it's rare that an app genuinely needs to relax TLS requirements for every server it will ever talk to, versus one specific legacy API or third-party SDK endpoint.

Common per-domain exception keys

NSAllowsLocalNetworking, for local development

If your app needs to reach a device on the local network during development or for a legitimate local-device-communication feature (an IoT companion app, for instance), NSAllowsLocalNetworking relaxes ATS specifically for local-network addresses without weakening anything for the public internet — a meaningfully different, narrower exception than either of the two above.

The right fix, in order of preference

Before reaching for any exception, the actually-correct fix is almost always upgrading the server's own TLS configuration to meet ATS's defaults — the same modern configuration (TLS 1.2+, forward-secret cipher suites, a properly chained certificate) that any other current client would also expect. Exceptions exist for cases genuinely outside your control: a third-party API you don't operate and can't influence, or legacy infrastructure with a defined, time-boxed upgrade plan. Treat an ATS exception as a documented, temporary accommodation rather than a permanent fixture of your app's configuration.

Comments

Loading comments…