afnetworking 添加https自定义证书
+ (AFSecurityPolicy*)customSecurityPolicy {
// 先导入证书
NSString *cerPath = [[NSBundle mainBundle] pathForResource: [APPConfig CAName] ofType:@"cer"];
NSData *certData = [NSData dataWithContentsOfFile:cerPath];
AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate withPinnedCertificates:[NSSet setWithObjects:certData, nil]];
securityPolicy.allowInvalidCertificates = YES;
securityPolicy.validatesDomainName = NO;
return securityPolicy;
}