0

I even added in info.plist file. But nothing seems to work. I am facing problem in connection to API using Alamofire due to this.

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <false/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>"https://test.idelivr.com"</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>TLSv1.1</string>
            </dict>
        </dict>
    </dict>
Isha Balla
  • 733
  • 2
  • 9
  • 25
  • Possible duplicate of [The resource could not be loaded because the App Transport Security policy requires the use of a secure connection](http://stackoverflow.com/questions/32631184/the-resource-could-not-be-loaded-because-the-app-transport-security-policy-requi) – Eric Aya Oct 28 '15 at 13:41
  • Also: http://stackoverflow.com/questions/32703226/app-transport-security-policy-requires-the-use-of-a-secure-connection?rq=1 (good example) – Eric Aya Oct 28 '15 at 13:46

2 Answers2

0

Actually I was trying to update in the wrong info.plist file. My bad :( This is the code I added and it worked fine for me now

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>test.test.com</key>
            <dict>
                <key>NSAllowsArbitraryLoads</key>
                <true/>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSExceptionRequiresForwardSecrecy</key>
                <true/>
                <key>NSExceptionMinimumTLSVersion</key>
                <string>TLSv1.2</string>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
                <key>NSThirdPartyExceptionMinimumTLSVersion</key>
                <string>TLSv1.2</string>
                <key>NSRequiresCertificateTransparency</key>
                <false/>
            </dict>
        </dict>
    </dict>
Isha Balla
  • 733
  • 2
  • 9
  • 25
-1

Try to add this in your root of info.plist

<?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>

Set arbitraryLoads to true.

razor118
  • 473
  • 4
  • 16
  • Using `NSAllowsArbitraryLoads=true` is a workaround App Transport Security, it's not the universal answer. And in our case, it seems like OP wants to use https for their domain. – Eric Aya Oct 28 '15 at 13:44