0

Sometime during the launch of my app this message appears on my console:

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.

This happens after my app delegate’s didFinishLaunchingWithOptions method finished. Stepping through the debugger lands me in the assembly-style code so I could not locate where I am violating Apple’s new App Transport Security policy.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
  • 1
    You could use an HTTP debugging proxy to log all the requests so you know what URL it's complaining about. Then you can try to find where your code calls it. It could also be a third party component. – i_am_jorf Aug 31 '16 at 21:17
  • Maybe try to `cd` into your project directory and search it with grep ( eg. `grep -Iron "http" /` ), if you want to include binary files then use `-ron`, to include the entire line in the output use `-rn`. The line number of the occurance of "http" is located at the end of each line in stdout. – l'L'l Sep 01 '16 at 00:02

1 Answers1

1

Somewhere in your code (or third party framework) you are firing an HTTP request and Xcode doesn't like it. Take a look at this workaround to silence the warning but have in mind that Apple will stop HTTP requests starting from 2017.

In your case I would go to Find->Find in Project and enter http:// to search through the entire list. This will list all files containing http requests. If there is a framework/library that it's code is not shared then you need to remove them one by one to check which one causes the warning. After finding it, re-download it from GitHub or pod update from CocoaPods to get the latest version.

Community
  • 1
  • 1
BlackM
  • 3,927
  • 8
  • 39
  • 69
  • Thanks, I did find the place where I was making the network connection. I am still wondering if there is a way to have the debugger do this work. I found another Question asking for a hook to trigger the debugger trip on any code outputting to the console. But that Question had no Answers. That is the kind of feature I am looking for. – Basil Bourque Sep 01 '16 at 00:32
  • I didn't understand exactly what you need. – BlackM Sep 01 '16 at 06:00