Explorar o código

Merge pull request #394 from mthole/mthole/default-ssl-validation

Use system provided SSL validation until proper customization is implemented
Mattt Thompson %!s(int64=10) %!d(string=hai) anos
pai
achega
34ad630371
Modificáronse 1 ficheiros con 6 adicións e 6 borrados
  1. 6 6
      Source/Alamofire.swift

+ 6 - 6
Source/Alamofire.swift

@@ -781,17 +781,17 @@ public class Request {
                 if challenge.previousFailureCount > 0 {
                     disposition = .CancelAuthenticationChallenge
                 } else {
-                    // TODO: Incorporate Trust Evaluation & TLS Chain Validation
 
                     switch challenge.protectionSpace.authenticationMethod! {
                     case NSURLAuthenticationMethodServerTrust:
-                        credential = NSURLCredential(forTrust: challenge.protectionSpace.serverTrust)
+                        // TODO: Incorporate custom Trust Evaluation & TLS Chain Validation
+                        // For now, fall back on default system SSL validation.
+                        break
                     default:
                         credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace)
-                    }
-
-                    if credential != nil {
-                        disposition = .UseCredential
+                        if credential != nil {
+                            disposition = .UseCredential
+                        }
                     }
                 }
             }