зеркало из https://github.com/github/AFNetworking.git
Fixed if/else logic
This commit is contained in:
Родитель
e6807f4176
Коммит
fa9fa6e0d4
|
@ -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];
|
||||
|
|
Загрузка…
Ссылка в новой задаче