I'm fetching an http document through a Squid proxy with Basic Auth, using an instance of objective-c's NSURLSession
class on iOS8.
I have implemented delegate methods for both URLSession:didReceiveChallenge:completionHandler:
and
URLSession:task:didReceiveChallenge:completionHandler:
, and declared the class as implementing both NSURLSessionDelegate
and NSURLSessionTaskDelegate
. My URLSession:task:didReceiveChallenge:completionHandler:
method does get called, but only after the OS has presented the user with a default dialog box requesting Auth for the HTTP proxy, and Cancel is pressed.
Anyone know why my method isn't called first? I would expect the default handling to happen only in the case that my delegate doesn't implement that method, or the method calls completionHandler(NSURLSessionAuthChallengePerformDefaultHandling)
.