Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS 9 App Transport Security has blocked a cleartext HTTP Issue

I am testing my app in Xcode 7, IOS 9 and got the following error :

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.

So I have done some changes in Info.plist file as below and application is now working fine across all IOS Versions:

<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 my doubt is whether this remains a permanent fix or whether I should use NSURLSession in my code.

Thanks, Abin

like image 702
Mobile Developer Avatar asked Feb 09 '23 03:02

Mobile Developer


1 Answers

Adding the following to your Info.plist will disable ATS

<key>NSAppTransportSecurity</key>  
<dict>  
    <key>NSAllowsArbitraryLoads</key><true/>  
</dict> 
like image 96
alcaamado Avatar answered Apr 29 '23 02:04

alcaamado