Merge branch 'master' of github.com:AFNetworking/AFNetworking
This commit is contained in:
commit
f0ba01ffd4
1 changed files with 7 additions and 7 deletions
|
|
@ -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];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue