在didReceiveAuthenticationChallenge中检索SSL证书字段 [英] Retrieve SSL certificate fields in the didReceiveAuthenticationChallenge
问题描述
我们的应用程序通过HTTPS与服务器通信。我们要重新验证客户端上的SSL证书字段。例如我想在HTTPS连接期间从服务器验证SSL证书问题的CN字段。是否有方法检索 didReceiveAuthenticationChallenge()
?
Our application communicates with server over HTTPS. We want to re-verify the SSL certificate fields on the client side. e.g. I want to verify the CN field of the SSL certificate issues from the server during HTTPS connection. Is there way to retrieve fields information in the didReceiveAuthenticationChallenge()
?
推荐答案
要了解如何执行SSL的步骤,请参阅 http ://www.symantec.com/theme.jsp?themeid = how-ssl-works
As a refresher of how the steps of SSL are performed can be found here http://www.symantec.com/theme.jsp?themeid=how-ssl-works
@Ramesh
(对于使用的函数,请查看此处 https://developer.apple.com/library/ios/#documentation/security/Reference/certifkeytrustservices/Reference/reference.html
(for the function used, please have a look here https://developer.apple.com/library/ios/#documentation/security/Reference/certifkeytrustservices/Reference/reference.html
继续执行
- SecTrustRef tR = [[challenge protectionSpace] serverTrust];
- 调用SecTrustEvaluate()
- 使用索引0调用SecTrustGetCertificateAtIndex(),然后您可以使用OpenSSL进行任何进一步的验证
这篇关于在didReceiveAuthenticationChallenge中检索SSL证书字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!