Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
526 views
in Technique[技术] by (71.8m points)

swift - HTTP load failed (error code: -999 [1:89]) for Task in iOS 11

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?

question from:https://stackoverflow.com/questions/44397240/http-load-failed-error-code-999-189-for-task-in-ios-11

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
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!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...