0

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.

soulshined
  • 9,612
  • 5
  • 44
  • 79
iOSTech
  • 77
  • 1
  • 8

3 Answers3

1

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.

deadbeef
  • 5,409
  • 2
  • 17
  • 47
  • When i tried curl i got the response - *** 301 Moved Permanently

    Moved Permanently

    The document has moved here.

    **** but the url i am using is HTTPS protected. do you think this is an issue from my server side ?
    – iOSTech Sep 01 '15 at 12:47
  • Can you show me the entire output of curl, including http headers ? What is the value of the Location header ? Is it a http or https link ? – deadbeef Sep 01 '15 at 13:28
1

Add it to your app info.plist

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Pallavi Konda
  • 1,640
  • 1
  • 12
  • 18
0

In your App's plist add:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
Andr3a88
  • 679
  • 5
  • 13