iOS开发https个人证书测试 WebView加载网页报错1202 9013处理 不适合上架

释放双眼,带上耳机,听听看~!

import “MainViewController.h”

@interface DistributeViewController : MainViewController
@property (nonatomic,copy)NSNumber *companyID;
@property(nonatomic,copy)NSString *pathStr;

@end

@interface NSURLRequest (ForSSL)

(BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host;

(void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString *)host;

@end

@implementation NSURLRequest (ForSSL)

(BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host{
return YES;
}
(void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString *)host{

}

@end

 

创建WebView的地方:

[NSURLRequest allowsAnyHTTPSCertificateForHost:self.pathStr];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.pathStr]]];

 

人已赞赏
iOS文章

iOS开发Https双向认证

2020-1-19 19:15:57

iOS文章

iOS-12 Xcode-10 新版本 libstdc++6.0.9

2020-1-20 10:46:30

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索