Merge branch 'master' of github.com:AFNetworking/AFNetworking

This commit is contained in:
Mattt Thompson 2013-08-20 16:44:47 -07:00
commit f0ba01ffd4

View file

@ -200,13 +200,13 @@ static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
static NSArray *_pinnedCertificates = nil; static NSArray *_pinnedCertificates = nil;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSMutableArray *certificates = [NSMutableArray array];
NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."]; for (NSBundle *bundle in [NSBundle allBundles]) {
NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."];
NSMutableArray *certificates = [NSMutableArray arrayWithCapacity:[paths count]]; for (NSString *path in paths) {
for (NSString *path in paths) { NSData *certificateData = [NSData dataWithContentsOfFile:path];
NSData *certificateData = [NSData dataWithContentsOfFile:path]; [certificates addObject:certificateData];
[certificates addObject:certificateData]; }
} }
_pinnedCertificates = [[NSArray alloc] initWithArray:certificates]; _pinnedCertificates = [[NSArray alloc] initWithArray:certificates];