1.请求报错结果
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2.解决方案
2.1.在info.plist文件里添加
在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES
2.2在AppDelegate.m里添加
@implementation NSURLRequest(DataController)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
return YES;
}
@end
注意:解决方案必须2.1和2.2同时修改才有效