0

I added this to my app Info.plist file to opt out of ATS:

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

Still getting this error when I try to do a GET request from my http resource (have no control over the server):

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.

My complete Plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSAppTransportSecurity</key>
  <dict>  
      <key>NSAllowsArbitraryLoads</key><true/>
  </dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>com.owlpixel.xxxxx</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>FMWK</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>$(CURRENT_PROJECT_VERSION)</string>
    <key>NSPrincipalClass</key>
    <string></string>
</dict>
</plist>

ATS should be disabled, why does it still block me? any ideas?

mindbomb
  • 1,642
  • 4
  • 20
  • 35
  • 1
    Check this, seems the same problem, check if the first solution help you http://stackoverflow.com/questions/32761042/swift-app-transport-security-has-blocked-a-cleartext-http-resource – Ulysses Mar 06 '16 at 01:30
  • I tried also with "NSExceptionDomains" and added my domain - same results – mindbomb Mar 06 '16 at 02:37
  • Did you tried all the classical "mystical cleans of the project", cmd+shfit+k/derived data and so on? – Ulysses Mar 06 '16 at 03:08
  • Can you give the address? I did this week a project with HTTP requesting from this server, and works fine with the same configs in the info.plis, check if this address works as expected or give the same error. http://www.camara.gov.br/SitCamaraWS/Deputados.asmx/ObterDeputados – Ulysses Mar 06 '16 at 03:11

2 Answers2

0

You should give following code in your plist.

  NSAllowArbitraryLoads  boolean  yes

SOURCE for question is below

Transport security has blocked a cleartext HTTP

Community
  • 1
  • 1
user3182143
  • 9,459
  • 3
  • 32
  • 39
0

Try to find if there are a lot of .plist files in you Xcode project (or Workspace).

I had the same problem and it was resolved by finding all Info.plist files in my Workspace and adding NSAppTransportSecurity logic to responsible for external (http://) calls .plist file.

Novamax
  • 11
  • 1