0

I am using following code in my plist to add my server exception to App Transport Security protocol.

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>172.16.4.139</key>
        <dict>
            <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>

but it is giving message "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.".

What i am doing wrong?

Hassy
  • 5,068
  • 5
  • 38
  • 63
  • Actually it is working, i used "ip-api.com" as domain, then it is working fine. But when i am giving local ip of my server it is not accepting it – Hassy Sep 23 '15 at 07:18
  • try the `NSThirdPartyExceptionMinimumTLSVersion` and `NSExceptionMinimumTLSVersion ` -> `TLSv1.1` – Buntylm Sep 23 '15 at 07:37

1 Answers1

2

Hard-coded IP address wont work in iOS 9.

Check this answer.

Community
  • 1
  • 1
Bart Hopster
  • 252
  • 1
  • 4