This commit is contained in:
Kevin Harwood 2013-04-09 08:47:26 -05:00
Родитель e6807f4176
Коммит fa9fa6e0d4
1 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -614,13 +614,11 @@ willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challe
if(self.allowInvalidSSLCertificate == YES){
NSURLCredential *credential = [NSURLCredential credentialForTrust:serverTrust];
[[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
} else {
[[challenge sender] cancelAuthenticationChallenge:challenge];
}
else {
SecTrustResultType result = 0;
OSStatus status = SecTrustEvaluate(serverTrust, &result);
NSAssert(status == noErr, @"SecTrustEvaluate error: %ld", (long int)status);
NSAssert(status == errSecSuccess, @"SecTrustEvaluate error: %ld", (long int)status);
if (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed) {
NSURLCredential *credential = [NSURLCredential credentialForTrust:serverTrust];