...
|
...
|
@@ -591,7 +591,11 @@ willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challe |
|
|
}
|
|
|
|
|
|
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
|
|
|
if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) {
|
|
|
NSString* host = [[self.request allHTTPHeaderFields] objectForKey:@"Host"];
|
|
|
if (!host) {
|
|
|
host = self.request.URL.host;
|
|
|
}
|
|
|
if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:host]) {
|
|
|
NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
|
|
|
[[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
|
|
|
} else {
|
...
|
...
|
|