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; }