I am building a simple iOS app that talks to Firebase using REST API.
Essentially, I am using NSURLSession.sharedSession().dataTaskWithRequest
to connect to
https://myusername.firebaseio.com/Object.json
The app works fine in iOS 8. I am able to pass GET/PUT/PATCH/DELETE to manipulate my data. But since iOS 9 introduced ATS, I now have the https error:
NSURLSession/NSURLConnection HTTP load failed
(kCFStreamErrorDomainSSL, CFNetwork SSLHandshake failed)
I am fully aware of the workaround solution in Info.plist. However, I want to utilize the new safety feature in iOS 9.
I checked Firebase connection security (by clicking on Chrome's green lock button), and it seems to be compatible with Apple's ATS requirement.
Is my error because of the way I use NSURLSession? Or is it because of the Firebase security setup?
PS: I tested https://firebase.com and NSURLSession connects fine w/o error. My app is also simple enough that I don't require auth.
Thank you for your help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…