IOS 9 App Transport Security blocked HTTP plaintext issue

I am testing my application in Xcode 7, iOS 9 and received the following error:

Transport application security has blocked the loading of the netartext HTTP resource (http: //) because it is unsafe. Temporary exceptions can be configured through the application's Info.plist file.

So, I made some changes to the Info.plist file, as shown below, and the application now works fine in all versions of iOS:

<key>NSAppTransportSecurity</key><dict>
<key>NSExceptionDomains</key><dict><key>myserver.com</key><dict>
<key>NSIncludesSubdomains</key><false/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/></dict> </dict></dict>

So, I doubt if this remains a permanent fix or should I use NSURLSession in my code.

Thanks Abin

+4
source share
2

Info.plist ATS

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

NSURLSession . , , - . , https, .

App Transport Security , , , . , . , , plist . , , ...

+1

Source: https://habr.com/ru/post/1605901/


All Articles