Change the default delegate method to allows optional cert in SSL verify, matches URLSession's behavior

This commit is contained in:
DreamPiggy 2021-05-23 11:36:39 +08:00
parent fd326e3d51
commit 18eda252d2
1 changed files with 3 additions and 1 deletions

View File

@ -565,7 +565,9 @@ didReceiveResponse:(NSURLResponse *)response
credential = self.credential;
disposition = NSURLSessionAuthChallengeUseCredential;
} else {
disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge;
// Web Server like Nginx can set `ssl_verify_client` to optional but not always on
// We'd better use default handling here
disposition = NSURLSessionAuthChallengePerformDefaultHandling;
}
} else {
disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge;