From f62c3f725b6cc9ca0a7a930c0bfc5d380c7596a6 Mon Sep 17 00:00:00 2001 From: huangling Date: Wed, 6 Jan 2016 17:24:44 +0800 Subject: [PATCH] ADD: add security policy property to YTKNetworkConfig Change-Id: Ic13c8abafcbaf7a4aec79c2f01badc92609b7ee1 --- YTKNetwork/YTKNetworkAgent.m | 1 + YTKNetwork/YTKNetworkConfig.h | 1 + YTKNetwork/YTKNetworkConfig.m | 1 + 3 files changed, 3 insertions(+) diff --git a/YTKNetwork/YTKNetworkAgent.m b/YTKNetwork/YTKNetworkAgent.m index 4fca670..40a0a7b 100644 --- a/YTKNetwork/YTKNetworkAgent.m +++ b/YTKNetwork/YTKNetworkAgent.m @@ -48,6 +48,7 @@ - (id)init { _manager = [AFHTTPRequestOperationManager manager]; _requestsRecord = [NSMutableDictionary dictionary]; _manager.operationQueue.maxConcurrentOperationCount = 4; + _manager.securityPolicy = _config.securityPolicy; } return self; } diff --git a/YTKNetwork/YTKNetworkConfig.h b/YTKNetwork/YTKNetworkConfig.h index 14d6d65..b17bc31 100644 --- a/YTKNetwork/YTKNetworkConfig.h +++ b/YTKNetwork/YTKNetworkConfig.h @@ -40,6 +40,7 @@ @property (strong, nonatomic) NSString *cdnUrl; @property (strong, nonatomic, readonly) NSArray *urlFilters; @property (strong, nonatomic, readonly) NSArray *cacheDirPathFilters; +@property (strong, nonatomic) AFSecurityPolicy *securityPolicy; - (void)addUrlFilter:(id)filter; - (void)addCacheDirPathFilter:(id )filter; diff --git a/YTKNetwork/YTKNetworkConfig.m b/YTKNetwork/YTKNetworkConfig.m index 5e573ca..0473948 100644 --- a/YTKNetwork/YTKNetworkConfig.m +++ b/YTKNetwork/YTKNetworkConfig.m @@ -42,6 +42,7 @@ - (id)init { if (self) { _urlFilters = [NSMutableArray array]; _cacheDirPathFilters = [NSMutableArray array]; + _securityPolicy = [AFSecurityPolicy defaultPolicy]; } return self; }