...
|
...
|
@@ -589,9 +589,13 @@ willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challe |
|
|
self.authenticationChallenge(connection, challenge);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
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 {
|
...
|
...
|
|