在 UIWebview 中允许未经验证的 ssl 证书 [英] Allow unverified ssl certificate in UIWebview

查看:18
本文介绍了在 UIWebview 中允许未经验证的 ssl 证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 UIWebView 中嵌入了一个网站.在开发过程中,我将它指向本地主机.问题是,每当它点击https://"网址时,它都不会加载.当我在 mobile safari 中加载 url 时,我得到了这个弹出窗口:

I'm embedding a website in a UIWebView. During development I have it pointed at localhost. The problem is that whenever it hits a "https://" url it doesn't load. When I load the url in mobile safari I get this popup:

有没有办法用 UIWebView 覆盖它以允许未经验证的 url?

Is there a way to override this with the UIWebView to allow the unverified url?

推荐答案

Nick 的回答将使您的应用无法在 App Store 中被 Apple 接受,George 的回答将无法加载具有 .css 或 .css 文件的页面的其余部分.js 或任何其他二次下载.有一个完整的答案 here 允许 UIWebView 从具有不受信任证书的站点加载页面.

Nick's answer will keep your app from being accepted by Apple in the App Store and George's answer will fail to load the remainder of a page that has .css or .js or any other secondary downloads. There is a complete answer here that allows the UIWebView to load pages from a site with an untrusted certificate.

这篇关于在 UIWebview 中允许未经验证的 ssl 证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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