为什么 IE8 错误地抱怨加载非安全元素?

发布于 2024-11-27 07:03:10 字数 833 浏览 0 评论 0原文

我管理一个在 SSL 下运行的电子商务网站。

问题发生在我的网站购物车的最后一页上,该购物车是在 SSL 下加载的。问题在于,Internet Explorer 8.0(包括版本 8.0.6001.18702 和其他版本的 IE8,但据报道并非所有版本的 IE8)至少抱怨一个非安全元素加载,这吓跑了一些人我的潜在客户。页面明显完全加载后(似乎没有丢失图像),IE8 会显示一个对话框,其中显示:

“安全警告:您是否只想查看之前的网页内容? 安全交付?该网页包含不会传送的内容 使用安全的 HTTPS 连接,这可能会危及网络的安全 整个网页。 (是/否)”

我试图追踪所有可能通过 HTTP 加载的无效图像和链接,但无济于事。Firebug Lite 没有显示任何不安全的内容。我开始认为这可能是 IE8 中的一个错误已在 IE9 中得到纠正,不会

重现此错误使用 IE8(或 Chrome)点击此处 将商品添加到您的购物车中,点击右侧的绿色按钮“继续安全结帐”。 IE8 的安全警告”。

问题:如何确定浏览器尝试非安全加载的内容,或者如何抑制“警告”消息

更新:这似乎是“安全警告” ”是由于该页面上的 JavaScript 执行被暂停。但同样的问题仍然存在。如何抑制或“调试”“安全警告”消息?

I manage an e-commerce site running under SSL.

The problem is happening on the final page of my site's shopping cart that loads under SSL. The problem is that Internet Explorer 8.0 (including version 8.0.6001.18702 and other versions of IE8, but reportedly not all versions of IE8) complain about at least one non-secure element loading, which is scaring away some of my prospective customers. IE8 displays a dialogue box after the page has apparently fully loaded (with seemingly no missing images) that says:

"Security Warning: Do you want to view only the web page content that was
delivered securely? This webpage contains content that will not be delivered
using a secure HTTPS connection, which could compromise the security of the
entire web page. (YES/NO)"

I tried to track down all invalid images and links that may be loading via HTTP, but no to avail. Firebug Lite shows nothing non-secure. I'm starting to think this may be a bug within IE8 that was corrected in IE9, which does not complain.

TO REPRODUCE THIS ERROR: Click here using IE8 (or Chrome) to add an item to your shopping cart. On the resulting page, click on the GREEN button on the right that says, "Proceed to Secure Checkout." You will notice that you see the above "Security Warning" from IE8.

QUESTION: How can I determine what the browser is attempting to load non-securely, or how can I suppress the "Warning" message?

UPDATE: It seems the "Security Warning" is due to the suspended JavaScript execution on this page. But the same question still remains. How can the "Security Warning" message be suppressed or "debugged"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

囍孤女 2024-12-04 07:03:11

正如乔恩所说:

如果您使用 removeChild() 删除包含设置背景图像的内联样式的 HTML 元素,则在旧版本的 IE8 中会出现警告。您可以通过将背景图像的内联样式设置移动到 HTML 头或外部样式表中设置的样式类来消除警告。

虽然 Microsoft 知识库页面 确实提供了修复程序,但最好的解决方案是按如下方式实现它(将在页面底部的脚本中):

Ext.removeNode = Ext.isIE ? function(){
    return function(n){
        if(n && n.tagName != 'BODY'){
            n.outerHTML = "";
        }
    }
}() : function(n){
    if(n && n.parentNode && n.tagName != 'BODY'){
        n.parentNode.removeChild(n);
    }
}

As Jon stated:

If you use removeChild() to remove an HTML element that contains an inline style setting a background image, the warning occurs in older versions of IE8. You can get rid of the warning by moving the inline style setting the background image into a style class set in the HTML head or external style sheet.

While the Microsoft KB Page does provide the fix, the best solution is to implement it as follows (place in a script at the bottom of your page):

Ext.removeNode = Ext.isIE ? function(){
    return function(n){
        if(n && n.tagName != 'BODY'){
            n.outerHTML = "";
        }
    }
}() : function(n){
    if(n && n.parentNode && n.tagName != 'BODY'){
        n.parentNode.removeChild(n);
    }
}
森罗 2024-12-04 07:03:10

如果 Wireshark 用于调试基于标准 Web 浏览器的应用程序,则通常纯粹是杀伤力大,因为它提供了获取许多信息的方法,而这些信息通常不需要精确定位问题。在这种情况下,更好的解决方案是使用 Fiddler 这是一个简单但非常强大的调试代理,除了许多有用的功能外,还能够清楚地区分 SSL 和非 SSL 流量。

它还能够模拟“中间人”测试环境,从而有效地破译 SSL 流量。当然,生成的“动态”证书在所有浏览器中都被明确标记为不可信,以防止滥用。

编辑:我按照给定的说明来引发问题,但 IE8 中的任何类型的安全警告都没有问题。 Fiddler 还显示所有资源都是通过 SSL 加载的。

Wireshark is usually pure overkill if its used to debug standard web browser based applications because it provides way to many information which are usually not required to exactly pinpoint the problem. A much better solution in this case would be to use Fiddler which is a simple yet a very powerful debugging proxy which is, aside from its many useful functionalities, also able to clearly distinguish between SSL and non-SSL traffic.

Its also able to simulate a "man in the middle" testing environment which effectively allows it to decipher SSL traffic. Of course the generated "on the fly" certificate is clearly marked as untrusted in all browsers to prevent misusing it.

EDIT: I followed the given instructions in order to provoke the problem yet I had no problems with any kind of security warnings in IE8. Also Fiddler is showing that all the resources are loaded through SSL.

昔日梦未散 2024-12-04 07:03:10

我知道这是一篇旧帖子,但由于没有发布答案来解决我的类似情况,我想我已经分享了我发现的内容,以防其他人偶然发现此页面。如果您使用 removeChild() 删除包含设置背景图像的内联样式的 HTML 元素,则旧版本的 IE8 中会出现警告。您可以通过将背景图像的内联样式设置移动到 HTML 头或外部样式表中设置的样式类来消除警告。

请参阅此 Microsoft KB 页面,其中说该故障仅发生在 IE6 和 IE7 中,但它发生在我在 XP 上的 IE8 上也是如此,同样的修复工作也有效。

I know this is an old post, but since there wasn't an answer posted that fixed my similar situation, I thought I'd shared what I found in case anyone else stumbles onto this page. If you use removeChild() to remove an HTML element that contains an inline style setting a background image, the warning occurs in older versions of IE8. You can get rid of the warning by moving the inline style setting the background image into a style class set in the HTML head or external style sheet.

See this Microsoft KB Page, which says the glitch only occurs in IE6 and IE7, but it happened to me on IE8 on XP, too, and the same fix worked.

往事随风而去 2024-12-04 07:03:10

我过去在使用 IE8 时遇到过类似的问题,看起来是缓存项目的问题。我无法完全确定它,因为像您一样,我检查了所有资产,没有发现任何未通过 SSL 加载的内容。但是,我注意到,如果我阻止所有缓存并强制 IE 从服务器加载所有资源,警告就会消失。

我不知道是否存在从缓存中提取的某些项目未被识别为安全的错误,但这似乎与此有关。

禁用缓存显然是解决仅影响一部分浏览器的问题的糟糕方法,但它可能是一个可以引导您走向正确方向的提示。

I ran into a similar problem in the past with IE8, and what it appeared to be was an issue with cached items. I wasn't able to completely pin it down because, like you, I checked every asset and found nothing that was not loading via SSL. However, I noticed that if I prevented all caching and forced IE to load all assets from the server, the warning disappeared.

I don't know if there's a bug where certain items pulled from cache don't get recognized as secure, but it seemed to have something to do with it.

Disabling caching is obviously a bad way to solve a problem that only impacts a subset of browsers, but it might be a tip that could lead you in the right direction.

吃不饱 2024-12-04 07:03:10

点击页面顶部的结账?

不再是 https 了吗?

Click checkout at the top of the page?

Not in https anymore is it?

混浊又暗下来 2024-12-04 07:03:10

如果您有 SSL 支持的页面,那么每个资源(js、css、图像)也应该由 HTTPS 协议提供服务。 90% 的浏览器都有相同的行为

If you have SSL-backed pages, then every assets (js, css, images) should be served by HTTPS protocol too. It's the same behaviour for 90% browsers

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文