• <bdo id='hlmON'></bdo><ul id='hlmON'></ul>

    <small id='hlmON'></small><noframes id='hlmON'>

        <i id='hlmON'><tr id='hlmON'><dt id='hlmON'><q id='hlmON'><span id='hlmON'><b id='hlmON'><form id='hlmON'><ins id='hlmON'></ins><ul id='hlmON'></ul><sub id='hlmON'></sub></form><legend id='hlmON'></legend><bdo id='hlmON'><pre id='hlmON'><center id='hlmON'></center></pre></bdo></b><th id='hlmON'></th></span></q></dt></tr></i><div id='hlmON'><tfoot id='hlmON'></tfoot><dl id='hlmON'><fieldset id='hlmON'></fieldset></dl></div>

        <tfoot id='hlmON'></tfoot>
      1. <legend id='hlmON'><style id='hlmON'><dir id='hlmON'><q id='hlmON'></q></dir></style></legend>

        如何在 iOS 中检查 SSL 证书的安全性?

        时间:2023-05-30
        <i id='rpvil'><tr id='rpvil'><dt id='rpvil'><q id='rpvil'><span id='rpvil'><b id='rpvil'><form id='rpvil'><ins id='rpvil'></ins><ul id='rpvil'></ul><sub id='rpvil'></sub></form><legend id='rpvil'></legend><bdo id='rpvil'><pre id='rpvil'><center id='rpvil'></center></pre></bdo></b><th id='rpvil'></th></span></q></dt></tr></i><div id='rpvil'><tfoot id='rpvil'></tfoot><dl id='rpvil'><fieldset id='rpvil'></fieldset></dl></div>

          <tbody id='rpvil'></tbody>

        <small id='rpvil'></small><noframes id='rpvil'>

      2. <legend id='rpvil'><style id='rpvil'><dir id='rpvil'><q id='rpvil'></q></dir></style></legend>
      3. <tfoot id='rpvil'></tfoot>

            • <bdo id='rpvil'></bdo><ul id='rpvil'></ul>

                  本文介绍了如何在 iOS 中检查 SSL 证书的安全性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我想检查 URL 中是否存在 SSL 证书,还想检查其版本和验证类型.

                  I wanna check whether the SSL certificate is present in the URL also wants to check its version and validation type.

                  我创建了一个应用程序,我在其中调用 NSURLConnection 委托方法以通过服务器发送请求.

                  I have created a application where I am calling the NSURLConnection delegate methods to send request over a server.

                  也使用了 "canAuthenticateAgainstProtectionSpace" 方法,但是一旦建立连接就不会调用此方法.

                  Also used "canAuthenticateAgainstProtectionSpace" method, but this method is not getting called once the connection is established.

                  我如何做到这一点?

                  推荐答案

                  iOS 无法提供对证书信息的非常精细的访问权限.您有两个选择:私有 API 或使用 OpenSSL 构建您自己的评估器.

                  iOS does not give you very granular access to certificate information. You have two choices: private APIs or build your own evaluator with OpenSSL.

                  您可以在opensource 中看到私有证书功能代码.该版本可从 SecCertificateVersion() 获得.我不确定您所说的验证类型"是什么意思.

                  You can see the private certificate functions in the opensource code. The version is available from SecCertificateVersion(). I'm not certain what you mean by "validation type" here.

                  要使用 OpenSSL 执行此操作,您可以使用 SecCertificateCopyData() 获取 DER 数据,然后自己解析所有内容.

                  To do this with OpenSSL, you can get the DER data with SecCertificateCopyData() and then parse everything yourself.

                  我建议就这个问题打开一个雷达 (bugreporter.apple.com).无法访问有关证书的基本信息是一个严重的问题.

                  I suggest opening a radar (bugreporter.apple.com) on this issue. The lack of access to basic information about the certificate is a serious problem.

                  如果您正在寻找从 NSURLConnection 中提取证书的示例代码,请参阅 第 11 章示例代码 来自 iOS:PTL:

                  If you're looking for sample code that extracts the certificate from the NSURLConnection, see the Chapter 11 sample code from iOS:PTL:

                  - (void)connection:(NSURLConnection *)connection
                    willSendRequestForAuthenticationChallenge:
                    (NSURLAuthenticationChallenge *)challenge
                  {
                    NSURLProtectionSpace *protSpace = challenge.protectionSpace;
                    SecTrustRef trust = protSpace.serverTrust;
                    ...
                      SecCertificateRef cert = SecTrustGetCertificateAtIndex(trust, 0);
                    ...
                  

                  此时,cert 持有您的叶子证书.

                  At this point, cert holds your leaf certificate.

                  这篇关于如何在 iOS 中检查 SSL 证书的安全性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:ios会在特定时间后终止在后台运行的应用程序吗 下一篇:如何在 iPhone 中制作无限滚动视图?

                  相关文章

                  最新文章

                • <i id='N6eSI'><tr id='N6eSI'><dt id='N6eSI'><q id='N6eSI'><span id='N6eSI'><b id='N6eSI'><form id='N6eSI'><ins id='N6eSI'></ins><ul id='N6eSI'></ul><sub id='N6eSI'></sub></form><legend id='N6eSI'></legend><bdo id='N6eSI'><pre id='N6eSI'><center id='N6eSI'></center></pre></bdo></b><th id='N6eSI'></th></span></q></dt></tr></i><div id='N6eSI'><tfoot id='N6eSI'></tfoot><dl id='N6eSI'><fieldset id='N6eSI'></fieldset></dl></div>

                    <tfoot id='N6eSI'></tfoot>
                  1. <small id='N6eSI'></small><noframes id='N6eSI'>

                    • <bdo id='N6eSI'></bdo><ul id='N6eSI'></ul>

                    1. <legend id='N6eSI'><style id='N6eSI'><dir id='N6eSI'><q id='N6eSI'></q></dir></style></legend>