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

查看:194
本文介绍了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/

首先,这两个网站都不会加载在我的UIWebView中使用标准的NSURL和NSURLRequest。我在网上查找了
的解决方案,有人建议使用NSURLProtocolClient委托方法。在
实现它们之后,我的UIWebView现在只会在学校邮件电子邮件中加载,当我有一个按钮时点击
直接打开链接,而不是尝试从门户网站访问邮件(上面的第3个链接),它
仍然从未加载计算机科学电子邮件链接。我已经搜索了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天全站免登陆