IOS:protocolCredentials和URLCredential之间的信任差异 [英] IOS: Difference between proposedCredentials and URLCredential for trust
问题描述
在 URLSession:task:didReceiveChallenge:completionHandler:
中,使用之间有区别 .proposedCredential
与这将作为委托方法的完成处理程序中的第二个参数以及 .useCredentials
.
This is to pass back as the second parameter in the completion handler of the delegate method, along with .useCredentials
.
推荐答案
在此处收到的答复: 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.
话虽如此,我建议您坚持循序渐进,并建立一个新的凭证.实际上,我很惊讶在这种情况下甚至填充了proposedCredential
.
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.
这篇关于IOS:protocolCredentials和URLCredential之间的信任差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!