I'm embedding a website in a UIWebView.我的网站嵌入在一个UIWebView。 During development I have it pointed at localhost.在发展过程中,我已经指出在localhost。The problem is that whenever it hits a "https://" url it doesn't load.现在的问题是,它击中一个“https://”开头的网址时,它不会加载。 When I load the url in mobile safari I get this popup:当我移动Safari浏览器中的URL,我得到这个弹出:
Is there a way to override this with the UIWebView to allow the unverified url?有没有办法覆盖的UIWebView允许未验证的URL吗?
If it's just for testing during development you can create a category on NSURLRequest and override the following private method:如果它只是用于测试在开发过程中,您可以创建一个类NSURLRequest覆盖下面的私有方法:
@implementation NSURLRequest (NSURLRequestWithIgnoreSSL)
Just remember to remove it before you submit the app, or Apple will reject it for private API violation.只要记住将其删除,然后再提交的应用程序,苹果将拒绝为私有API违反。