Getting -1012 (NSURLErrorUserCancelledAuthentication) for all my download requests

Since upgrading my app to iOS 9, I get Error Domain=NSURLErrorDomain Code=-1012 for all my download network requests.

Any ideas why and what can be done?

Accepted Answer

This is probably because of a new "security" feature. iOS 9 enforces secure connections, so all normal "http" connections will fail by default. Right now this won't work for many use cases, so you can opt-out for specific domains or even completely. Look for the keyword "App Transport Security" (ATS).

You'll find some more information in this thread:

https://forums.developer.apple.com/message/5857

Getting -1012 (NSURLErrorUserCancelledAuthentication) for all my download requests
 
 
Q