Ứng dụng cũ của chúng tôi sử dụng MKNetworkKit và MKNetworkOperation.Giải pháp thay thế cho kSecTrustResultConfirm trong iOS 7 là gì?
Hiện không hỗ trợ iOS 7 kSecTrustResultConfirm
. Trong MKNetworkOperation, có mã này:
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];
}
}
là có thay thế cho kSecTrustResultConfirm
?
Cùng một vấn đề ở đây, bạn đã giải quyết nó chưa? – Vik
Tài liệu tham khảo: https://developer.apple.com/library/ios/documentation/Security/Reference/certifkeytrustservices/Reference/reference.html#//apple_ref/c/econst/kSecTrustResultConfirm –
Tôi tin rằng bạn không còn cần để kiểm tra trường hợp này trong iOS 7 vì giá trị này không bao giờ được trả lại. Trong ngắn hạn khối mã có điều kiện trên COULD này đượC# ifdef'd và bỏ qua. Không chắc chắn mặc dù. Vẫn cố gắng quấn quanh đầu toàn bộ API. –