第一步:
导入afn库
第二步:
在pch中添加
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#define AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES
第三步:
AFSecurityPolicy *securityPolicy = [AFSecurityPolicy defaultPolicy];
securityPolicy.allowInvalidCertificates = YES;
AFHTTPRequestOperationManager *manger = [AFHTTPRequestOperationManager manager];
manger.securityPolicy = securityPolicy;
[manger POST:urlString parameters:dic success:^(AFHTTPRequestOperation *operation, id responseObject) {
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
}];