I\'m currently working on Xcode 7 beta 6. I\'m trying to send a \"DELETE\" request to http://mySubdomain.herokuapp.com
The error I receive is:
I have solved it with adding some key in info.plist. As I am using objective C for some native application.
The steps I followed are:
Opened my Projects info.plist
file
Added a Key called NSAppTransportSecurity
as a Dictionary
.
NSAllowsArbitraryLoads
as Boolean
and set its value to YES
as like following image.Clean the Project and Now Everything is Running fine as like before.
Ref Link:
https://stackoverflow.com/a/32631185/2905967
https://stackoverflow.com/a/32609970
In Xcode 8 & Xcode 9
AppTransportSecurity
as a Dictionary.AllowsArbitraryLoads
as Boolean and set its value to YES as like following image.I, too, had trouble overriding App Transport Security after upgrading to xCode 7.0, and tried the same kinds of solutions you have to no avail. After walking away from it for awhile, I noticed that I had made the changes to the Info.plist under Supporting Files of "MyAppName Tests" rather than the one in the project itself. The Supporting Files folder in my project wasn't expanded, so I hadn't even noticed the Info.plist in it.
Typical amateur mistake, I'm sure, but they're only a couple of lines apart in the Project Navigator and it had me frustrated until I noticed the distinction. Thought I'd mention it in case you're having the same problem.
I have solved as plist file.
1. Add a NSAppTransportSecurity : Dictionary
.
2. Add Subkey named NSAllowsArbitraryLoads
as Boolean : YES
This worked well.
Appreciate you've tried adding the following, to your plist file:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
... you might want to try to change your line:
let url = NSURL(string:"https://mysubdomain.herokuapp.com/42kh24kh2kj2g24/clean")
to:
let url = NSURL(string:"http://mysubdomain.herokuapp.com/42kh24kh2kj2g24/clean")
Apologies if you have tried this. I can understand how frustrating it is when you think you've exhausted all avenues.
But as soon as I ran up my App on Xcode 7, so that I could test our Apps, one kicked off with the "App Transport Security" problem. We're using Oracle-based web-services and it's too late in the day to start configuring digital certificates for SSL-based HTTP. So, the above addition to my plist file did the trick. Appreciate you say you've tried this. But, just to help anyone else, it did actually work for me. It need to as I have no immediate way of enabling SSL on our Oracle box.