webView加载不信任HTTPS页面

@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

 NSURLRequest *request=[NSURLRequest requestWithURL: [NSURL URLWithString:authPagePath]];

[NSURLRequest setAllowsAnyHTTPSCertificate:YESforHost:kDomain];
[webView loadRequest:request];

 

posted @ 2013-01-23 18:40  Ethan_村长  阅读(6422)  评论(0编辑  收藏  举报