iOS 9 - App Transport Security wont load XML files

587 Views Asked by At

I am upgrading my app to iOS9. To Support ATS i had shifted all my urls to https. But ATS is throwing below error on XML files. The JSON files located at the same location have no problem.

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

JSON URL: https://www.example.com/content/123.xml

XML URL: https://www.example.com/content/123.json

Please suggest what might be the issue ? Thanks in advanced.

3

There are 3 best solutions below

2
On BEST ANSWER

Run the following commands in Terminal :

curl -v 'https://www.example.com/content/123.xml'
curl -v 'https://www.example.com/content/123.json'

It is highly probable that your server doesn't support SSL and redirects your url towards a standard http download.

If this is the case there will be a Location header that indicates the new url.

0
On

In your App's plist add:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
0
On

Add it to your app info.plist

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>