2

I'm compiling an Ionic (1.1.0) app in Xcode 7 for an iOS 9 device. However images coming through Cloudfront CDN are not appearing. The error message is:

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

I am sending https versions of the URL though for these images. For example https://abcxyx.cloudfront.net/...

I've tried the recommendation from here: https://www.stuartbreckenridge.com/app-transport-security-cloudfront/ But it did not work.

Just as a test I set NSAllowsArbitraryLoads to true and that did work. But of course that's not a production solution that will get accepted in the App Store.

Here is an excerpt from my plist:

<dict>
<key>[SUBDOMAIN].cloudfront.net</key>
<dict/>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>

Anyone seen this or have ideas?

realdeal
  • 153
  • 1
  • 11
  • It may be helpful for you NSURLSession/NSURLConnection HTTP load failed on iOS 9 http://stackoverflow.com/questions/30739473/nsurlsession-nsurlconnection-http-load-failed-on-ios-9 – Nanthakumaran Sep 21 '15 at 16:14

1 Answers1

2

I have a bad news for you, my friend. A couple of days ago, I was having that problem. There is unfortunately no solution for that. Apple has blacklisted cloudfront's certificates.

So, either you go with that solution you have provided (whitelisting url) or you have to go with different image provider/server.

virusss8
  • 235
  • 1
  • 4
  • 19