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 system does not actually look at the trust object embedded in the credential you pass to the completion handler; all that matters is that you pass in something.

Having said that, I recommend that you stick on the well-trodden path and construct a new credential. I’m actually quite surprised that proposedCredential is even populated in this case.



来源:https://stackoverflow.com/questions/56224690/ios-difference-between-proposedcredentials-and-urlcredential-for-trust

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!