iOS 7中kSecTrustResultConfirm的替代方法是什么?

6
我们的旧应用程序使用MKNetworkKit和MKNetworkOperation。
现在在iOS 7下,kSecTrustResultConfirm已经被弃用。 在MKNetworkOperation中,有这段代码:
 else if(result == kSecTrustResultConfirm) { // DEPRECATED

          if(self.shouldContinueWithInvalidCertificate) {

            // Cert not trusted, but user is OK with that
            DLog(@"Certificate is not trusted, but self.shouldContinueWithInvalidCertificate is YES");
            [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge];
          } else {

            DLog(@"Certificate is not trusted, continuing without credentials. Might result in 401 Unauthorized");
            [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge];
          }
        }

有没有kSecTrustResultConfirm的替代品?

这里也有同样的问题,你解决了吗? - Vik
文档参考:https://developer.apple.com/library/ios/documentation/Security/Reference/certifkeytrustservices/Reference/reference.html#//apple_ref/c/econst/kSecTrustResultConfirm - Warren P
我相信在iOS 7中您不再需要检查这种情况,因为这个值永远不会被返回。简而言之,这个有条件的代码块可以被#ifdef'd并忽略。不过还不确定。仍在努力理解整个API。 - Warren P
1个回答

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接