https 问题的解决
这里时候后台自己生成的免费证书
1.找后台要一个生成的cer文件
2.直接拖进你的工程里面
3.在你以前封装的好的网络里面添加以下代码
NSString * cerPath = [[NSBundle mainBundle] pathForResource:@"myCA" ofType:@"cer"];
NSData * cerData = [NSData dataWithContentsOfFile:cerPath];
_manager.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone withPinnedCertificates:[[NSSet alloc] initWithObjects:cerData, nil]];
_manager.securityPolicy.allowInvalidCertificates = YES;
[_manager.securityPolicy setValidatesDomainName:NO];
注意 :一定要把你info plist 绕过https 的yes 删除
文/福建王海林(简书作者)
原文链接:http://www.jianshu.com/p/b1c4cd92b85c
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
http://www.jianshu.com/p/36ddc5b009a7?utm_campaign=hugo&utm_medium=reader_share&utm_content=note&utm_source=qq
http://mp.weixin.qq.com/s/rsnw8l0cs5Rd2FJ_Yt3arA
sdwebimage
[imageView sd_setImageWithURL:[NSURL URLWithString:urlString] placeholderImage:self.placeholder options:SDWebImageAllowInvalidSSLCertificates];