UIWebView 不会加载带有证书的链接(https://前缀) [英] UIWebView won't load links with certificate (https:// prefix)

查看:12
本文介绍了UIWebView 不会加载带有证书的链接(https://前缀)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道以前有人问过这个问题,但我已经查看了每个答案(没有很多),但没有一个能帮助我.

I know this has been asked before but I have looked at every answer (there aren't many) and none help me.

我遇到的问题是使用我的学校电子邮件服务处理证书.两种电子邮件服务的链接在这里:

The issue I am running into is dealing with certificates with my schools e-mail service. The links for the two e-mail services are here:

主校邮箱:https://marauder.millersville.edu/mail/index.pl

计算机科学电子邮件:https://cs.millersville.edu/cswebmail

Computer Science e-mail: https://cs.millersville.edu/cswebmail

大学生门户网站(在我的 UIWebView 中单击右侧的 Marauder Mail 按钮时未打开)
http://myville.millersville.edu/

University student portal (Marauder Mail button on the right doesn't open when clicked in my UIWebView)
http://myville.millersville.edu/

起初,这两个网站都不会使用标准的 NSURL 和 NSURLRequest 加载到我的 UIWebView 中.我看了在网上寻找解决方案,有人建议使用 NSURLProtocolClient 委托方法.后实现它们,我的 UIWebView 现在将仅在我有一个按钮时才加载学校邮件clicked 直接打开链接,而不是尝试从门户网站访问邮件(上面的第三个链接),它仍然从不加载计算机科学电子邮件链接.我搜索了 iOS 帮助网站,发布了问题,尝试过多个开源自定义 UIWebViews,但我没有找到任何可行的方法.

At first neither of the websites would load in my UIWebView using a standard NSURL and NSURLRequest. I looked on the web for a solution and someone suggested using the NSURLProtocolClient delegate methods. After implementing them, my UIWebView will now load the schools mail e-mail ONLY when I have a button that when clicked opens the link directly, as opposed to trying to access the mail from the portal site (3rd link above), and it still never loads the computer science e-mail link. I have scoured the iOS help sites, posted questions, tried multiple open-source custom UIWebViews, but I have not found anything that works.

我在网上阅读的大多数答案都指向 ASIHTTPRequest.我已经尝试过了,但我无法正确实现它,它不会在我的 UIWebView 中加载链接;这是我如何加载链接的代码:

Most answers I have read around the web point to ASIHTTPRequest. I have tried this but I cannot implement it right, it doesn't load the links in my UIWebView; here is my code for how I am loading a link:

mURL = [self getURL:viewNumber];
ASIHTTPRequest *req = [ASIHTTPRequest requestWithURL:mURL];
[req setDelegate:self];
[req startSynchronous];

//NSURLRequest *req = [NSURLRequest requestWithURL:mURL];
//urlConnection=[[NSURLConnection alloc] initWithRequest:req delegate:self];
webView.scalesPageToFit = YES;
//[webView loadRequest:req];

注释中的代码是我如何在没有 ASIHTTPRequest 的情况下加载链接.

Code in comments is how I load a link without ASIHTTPRequest.

感谢任何帮助!

另外,我的 UIWebView 还有一个问题,链接如下.我没有任何答案,所以如果您感到无聊,请查看:UIWebView 未检测到网站上的文本框

Also, I have another issue with my UIWebView, link is below. I haven't had any answers so if you're bored please check it out: UIWebView doesn't detect text box on website

推荐答案

解决了我的问题,我能够使用以下代码毫无问题地加载 https 我不认为这会起作用,但确实如此!:

Fixed my issue, I was able to load https with no problem with the following code I didn't think this would work but it does!:

NSURLRequest *req = [NSURLRequest requestWithURL:mURL];
urlConnection=[[NSURLConnection alloc] initWithRequest:req delegate:self];
webView.scalesPageToFit = YES;
[webView loadRequest:req];

这篇关于UIWebView 不会加载带有证书的链接(https://前缀)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆