Authored by 朱小军

修改httpdns的IP直连SSL认证问题 review by 小熊

... ... @@ -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 {
... ...