-
Notifications
You must be signed in to change notification settings - Fork 472
App Transport Security
In iOS 9, Apple introduced "App Transport Security," or ATS. This defaults apps to requiring an HTTPS connection, and returning an error for non-HTTPS connections.
With modern web services, there is no reason to send data in the clear. Thanks to SSL session reuse, performance should no longer be a concern. All data should be sent over SSL.
These new defaults are useful for countering "leaks." While your may have moved all your REST API endpoints to HTTPS, they may reference insecure resources, such as image assets.
Unfortunately, you may have to connect to APIs outside of your control which do not offer HTTPS.
You can poke holes in ATS by adding a NSAppTransportSecurity
dictionary to Info.plist. Add an NSExceptionDomains
dictionary to whitelist specific domains. It may resemble:
-
NSAppTransportSecurity
-
NSExceptionDomains
- api.rottentomatoes.com
-
NSExceptionAllowsInsecureHTTPLoads
: YES
-
- api.rottentomatoes.com
-
You may also use NSAllowsArbitraryLoads
to completely disable ATS in your app.
-
NSAppTransportSecurity
-
NSAllowsArbitraryLoads
: YES
-
This is strongly discouraged. Only use this during development.