forked from AFNetworking/AFNetworking
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pinning failure better error (AFNetworking#3425)
* Error code on pinning failure must be meaningful `NSURLErrorServerCertificateUntrusted` instead of `NSURLErrorCancelled` * Remove unneeded __block qualifier * Add warnings about implementing an authentication challenge block * Simpler session-level authentication request handling Handle session-level authentication requests exclusively through user-provided `sessionDidReceiveAuthenticationChallenge` block. When `sessionDidReceiveAuthenticationChallenge` is not set, go through the `URLSession:task:didReceiveChallenge:completionHandler:` delegate method instead. * Precise error when the server trust is invalid Fixes #3165 * Better server trust error with userInfo dictionary * Simplify code flow * Better setSessionDidReceiveAuthenticationChallengeBlock: documentation * Do not completely bypass the security policy Let the possibility to the `taskDidReceiveAuthenticationChallenge` block to fallback to security policy evaluation by returning `NSURLSessionAuthChallengePerformDefaultHandling`. * Better expectation descriptions for invalid server trust tests * Rename ServerTrustErrorKey into AuthenticationChallengeErrorKey * New authentication challenge hander block Deprecate `setTaskDidReceiveAuthenticationChallengeBlock:` in favor of the new `setAuthenticationChallengeHandler:` method. The new challenge handler allows * The user to handle the completion handler themself (fixes #2520) * The security policy to be evaluated * Aborting the connection with a proper error (see also #3165) * Fix nullability annotation * Throw if the authentication challenge handler returns an invalid value * Document -[AFURLSessionManager setAuthenticationChallengeHandler:]
- Loading branch information
Showing
3 changed files
with
115 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters