App Transport Security, Xcode 7.1 & iOS 9.1

Colleagues


Came across something strange when testing an upgraded Xcode 7.1 with Swift 2.1 for webviews.


Updated the plist.info to reflect the required settings (note some of the previous names for keys have changed!!):


NSAppTransportSecurity (key now auto updates to App Transport Security Settings)

NSAllowsArbitraryLoads (key now auto updates to Allow Arbitrary Loads)

NSExceptionDomains (key now auto updates to Exception Domains)

<domain name>

NSExceptionAllowsInsecureHTTPLoads

NSIncludesSubdomains


Testing this on iPhone simulator under iOS 8 works fine. Now with iOS 9.1 simulator and on a device the webload fails with the following error reported:


Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection."


Checked the App Transport Security Technote to see if there is anything else changed. The release notes for Xcode 7.1 does not shed any light on ATS (note this document still uses the previous name for all keys and has not been updated to refelct changes introduced in Xcode 7.1).


App builds for iOS 9.1 appear to ignore or overwrite the plist settings.


a) Has anyone else discovered this anomaly?

b) Is this a bug or the strong signal from Apple that all Apps must now link only to HTTPS websites?


Any thoughts or suggestions welcome. Thanks.

Replies

Yes having similar issue.
First, i thought something is wrong with plist file, but after checking for a hundred times - i cannot agree more.


Xcode overrides any configurations you add regarding the NSAppTransportSecurity.


Looking forward to any advices here.

(note some of the previous names for keys have changed!!)

The key changes are just Xcode being ‘helpful’ and showing you user-friendly values. Personally I prefer to use raw values, which you can get by choosing Editor > Show Raws Keys & Values.

Testing this on iPhone simulator under iOS 8 works fine.

Huh? ATS was only implemented in iOS 9, so you’d expect things to always work in iOS 8.

AFAIK there’s been no substantial ATS policy changes in iOS 9.1 vs iOS 9.0. Have you tried your app on iOS 9.0.x to see how it behaves there?

Share and Enjoy

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

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

I am also facing the same Issue. I am using XCode 7.1 on OS X El Capitan.


I have used the changed key "App Transport Securtiy Settings" in info.plist file. But still I am getting the same error.

I have checked it for tvOS. with beta version it was working fine but in XCode 7.1 it is not working.

Hi,


I saw a simular problem. I had both the NSExceptionDomains & NSAllowsArbitraryLoads keys in my plist, and all URL calls were failing. I removed the NSExceptionDomains key, and kept the NSAllowsArbitraryLoads key, and it started working again (Xcode 7.1 and iOS 9.1 simulator).

Trust me folks, ATS is working just fine in iOS 9.1 and OS X 10.11, regardless of whether you use Xcode 7.0 or 7.1. If you’re having ATS problems, it’s very likely that’s because ATS is not happy with your server. If the

Info.plist
settings are not working for you, it’s very likely that you’re not setting them up correctly.

I can sympathise here. This stuff is super tricky. Moreover, some folks have actually encountered oddities in ATS, or other problems that look like ATS bugs because they affect TLS connections in non-obvious ways. However, my experience so far is that the majority of ATS issues are caused by folks configuring ATS incorrectly (with the underlying cause being, of course, that our documentation and diagnostics are not exactly stellar).

Rather than piling on this thread I recommend that each of your who is having a problem with ATS start a new thread. Your post should include:

  • the output from

    TLSTool
    , as described here
  • a copy of the

    NSAppTransportSecurity
    entry from your
    Info.plist

    IMPORTANT Don’t rely on what Xcode shows you. Use a text editor to copy this out of your built binary.

  • a summary of what OS releases you’ve been testing on

Share and Enjoy

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

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

Can you look into why the Technote is missing? Devs have no reference anymore for ATS.

Can you look into why the Technote is missing?

The content of the technote got moved into the Information Property List Key Reference. I updated the App Transport Security post, in the Announcements sidebar, with a link.

There should be a redirect from the old ATS Technote URL to this new location but that was dropped due to a mixup at our end; I’m trying to get it resolved (r. 23097610).

Share and Enjoy

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

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

I found an interesting thing, I use Xcode7 config

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key>

<true/>

</dict> ,

and then back Xcode6 development for a period of time for the same project, and finally to the Xcode7 package,test, found that the addition of the configuration is invalid, delete the configuration and then add it in Xode7 again,finally configuration plays work, I want to know why?