标签:cat 证书 center main font user log failure name
YTKNetworkConfig *config = [YTKNetworkConfig sharedConfig];
config.baseUrl = @"https://139.224.186.241:8443/ma/";
// config.baseUrl = @"http://192.168.10.20:8095/CNParkAppService";
config.cdnUrl = @"http://218.17.152.138:8095/CNParkAppService-2.0/";
config.securityPolicy.allowInvalidCertificates = YES;
config.securityPolicy.validatesDomainName = NO;
// AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:request.pinningMode];
// [securityPolicy setAllowInvalidCertificates:YES];
// [securityPolicy setValidatesCertificateChain:request.validatesCertificateChain];
// [securityPolicy setValidatesDomainName:request.validatesDomainName];
// [securityPolicy setPinnedCertificates:customSecurityCertificates];
// 方式一 两句就可以-----ca证书
// AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
// manager.responseSerializer = [AFHTTPResponseSerializer serializer];
// manager.securityPolicy.validatesDomainName = NO; // 关键语句1
// manager.securityPolicy.allowInvalidCertificates = YES; // 关键语句2
//// [manager GET:@"https://kyfw.12306.cn/otn/leftTicket/init" parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
//// NSLog(@"=================%@", responseObject);
//// } failure:^(NSURLSessionDataTask *task, NSError *error) {
////
//// }];
// [manager POST:@"https://139.224.186.241:8443/ma/userBase/register" parameters:nil progress:^(NSProgress * _Nonnull uploadProgress) {
//
// } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
// NSLog(@"=================%@", responseObject);
// } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
//
// }];
标签:cat 证书 center main font user log failure name
原文地址:http://www.cnblogs.com/YangFuShun/p/6110668.html