I am facing a CFNetwork SSL Handshake error while uploading a video file using NSURLSession UploadTask when the App is in background. There is no problem uploading the videos when the app is in foreground. Problem arises only when the app is in background.
Asked
Active
Viewed 1.1k times
6
-
Have the same problem. Disappears with NSURLConnection. Have you found the solution? – Daniyar Dec 08 '14 at 11:35
1 Answers
1
Backgrounded NSURLSession
's handle a lot of things differently, including auth. I'd recommend you carefully read everything about background sessions and tasks in Apple's URL Loading System Programming Guide, particularly the section on Background Transfer Considerations.
You might also try see what you get when you set a session delegate which implements the callback:
-[NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:]
.

Clay Bridges
- 11,602
- 10
- 68
- 118
-
Hi I tried using the deleagte. When I print the protection space I get this "Server:https, Auth-Scheme:NSURLAuthenticationMethodServerTrust" with some more information. When I try to by pass this using NSURLSessionAuthChallengePerformDefaultHandling the chunk transfers with series of did receive challenges fired back again and then the connection breaks with error "An SSL error has occurred and a secure connection to the server cannot be made while uploading a file using nsurlsession". Any ideas on what might be going wrong ? – user2643583 Apr 01 '14 at 08:55
-
Sorry, no. You might be better off updating your question with that info though. – Clay Bridges Apr 01 '14 at 21:11