Restore previous method organization

Sorry @keithduncan, I just wanna make sure people can spot the
difference between old and new.
This commit is contained in:
Justin Spahr-Summers 2014-10-06 13:28:47 -07:00
Родитель c0e505c0b5
Коммит 0d5dd5ba58
1 изменённых файлов: 64 добавлений и 65 удалений

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

@ -579,15 +579,7 @@ willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challe
return;
}
if (![challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
if ([challenge previousFailureCount] == 0 && self.credential != nil) {
[[challenge sender] useCredential:self.credential forAuthenticationChallenge:challenge];
}
[[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge];
return;
}
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
SecTrustRef serverTrust = challenge.protectionSpace.serverTrust;
SecPolicyRef policy = SecPolicyCreateBasicX509();
@ -671,6 +663,13 @@ willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challe
}
}
}
} else {
if ([challenge previousFailureCount] == 0 && self.credential != nil) {
[[challenge sender] useCredential:self.credential forAuthenticationChallenge:challenge];
}
[[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge];
}
}
- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection __unused *)connection {