authenticationchallenge

iOS: trigger NSURLErrorServerCertificateUntrusted instead of NSURLErrorCancelled when failing the AuthenticationChallenge

左心房为你撑大大i 提交于 2020-01-06 07:59:44
问题 I'm handling the server trust authentication challenge in a custom way (comparing the public key from the server trust with a hashed local version) through the urlSessionDelegate, similarly to how it is done here: How do I accept a self-signed SSL certificate using iOS 7's NSURLSession and its family of delegate methods for development purposes? As described in the documentation, I need to cancel the challenge if I want to fail the server trust authentication myself. When doing this, my data

IOS: Difference between proposedCredentials and URLCredential for trust

一笑奈何 提交于 2019-12-13 03:16:33
问题 In URLSession:task:didReceiveChallenge:completionHandler:, is there a difference between using .proposedCredential vs URLCredential(trust:) of the server trust object in the challenge protection space? This is to pass back as the second parameter in the completion handler of the delegate method, along with .useCredentials. 回答1: Answer received here: https://forums.developer.apple.com/message/361609 Realistically there’s no difference here. For server trust authentication challenges, the