39

I'm using URLSession to perform a datatask, when I run it on iOS 11, I get a console error:

HTTP load failed (error code: -999 [1:89]) for Task <68809C58-C6A7-4F10-86A4-81396D8B18CF>.<2>  

Any thought on what's causing it, or how to fix it?

Sam Spencer
  • 8,492
  • 12
  • 76
  • 133
Ennabah
  • 2,303
  • 2
  • 20
  • 39

3 Answers3

10
HTTP load failed (error code: -999 [1:89]) for Task

Error -999 means NSURLErrorCancelled, your request has been canceled before completion. According to the apple developer blog, there are few changes with ATS (likely that your server is using one of legacy crypto facilities that have been removed in iOS 11.) So give a try and implement the connection:didReceiveAuthenticationChallenge: and see if your server raises authentication challenge if yes then here is something we need to handle.

I hope it will help!

Buntylm
  • 7,345
  • 1
  • 31
  • 51
1

I had this error when trying to do the HTTPS

Request has been canceled before completion In my case the SSL Certificated was not installed properly.

Check your SSL certificate if your using one. Task <1> HTTP load failed (error code: -999 [1:89]) Task <>.<1> finished with error - code: -999

user3826696
  • 1,045
  • 12
  • 13
0

Make sure your internet connection is working. It happened to me that it's working in the simulator, but got the error on iphoneSE. I found it that my iphoneSE internet connection had a problem.

Muhammad Fauzi Masykur
  • 1,994
  • 1
  • 15
  • 18