2
0
Эх сурвалжийг харах

For SSL validation, use default system validation until custom behavior is properly implemented.

Michael Thole 10 жил өмнө
parent
commit
63a00ae700

+ 6 - 6
Source/Alamofire.swift

@@ -741,17 +741,17 @@ public class Request {
                 if challenge.previousFailureCount > 0 {
                 if challenge.previousFailureCount > 0 {
                     disposition = .CancelAuthenticationChallenge
                     disposition = .CancelAuthenticationChallenge
                 } else {
                 } else {
-                    // TODO: Incorporate Trust Evaluation & TLS Chain Validation
 
 
                     switch challenge.protectionSpace.authenticationMethod! {
                     switch challenge.protectionSpace.authenticationMethod! {
                     case NSURLAuthenticationMethodServerTrust:
                     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:
                     default:
                         credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace)
                         credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace)
-                    }
-
-                    if credential != nil {
-                        disposition = .UseCredential
+                        if credential != nil {
+                            disposition = .UseCredential
+                        }
                     }
                     }
                 }
                 }
             }
             }