App Transport Security Xcode 7 beta 6

前端 未结 5 571
臣服心动
臣服心动 2020-12-07 22:41

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:

相关标签:
5条回答
  • 2020-12-07 23:12

    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:

    1. Opened my Projects info.plist file

    2. Added a Key called NSAppTransportSecurity as a Dictionary.

    3. Added a Subkey called 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:

    1. https://stackoverflow.com/a/32631185/2905967

    2. https://stackoverflow.com/a/32609970

    0 讨论(0)
  • 2020-12-07 23:18

    In Xcode 8 & Xcode 9

    1. Open my Projects info.plist file
    2. Add a Key called AppTransportSecurity as a Dictionary.
    3. Add a Subkey called AllowsArbitraryLoads as Boolean and set its value to YES as like following image.

    0 讨论(0)
  • 2020-12-07 23:20

    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.

    0 讨论(0)
  • 2020-12-07 23:31

    I have solved as plist file.
    1. Add a NSAppTransportSecurity : Dictionary.
    2. Add Subkey named NSAllowsArbitraryLoads as Boolean : YES

    This worked well.

    0 讨论(0)
  • 2020-12-07 23:37

    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.

    0 讨论(0)
提交回复
热议问题