小编tln*_*g05的帖子

iframe 被阻止为不安全的内容,即使 iframe 是 HTTPS

我正在尝试将 iframe(包含shellinabox,如果相关)嵌入到 HTTPS 网页上。我用来嵌入 iframe 的 HTML 非常简单:

<div class="jumbotron" style="min-height: 400px;">

    <iframe src="https://example.com/shellinabox" style="border:none; min-height: 400px;" width="100%"></iframe>
</div>
Run Code Online (Sandbox Code Playgroud)

但是,Chrome 阻止加载 iframe,因为它是“不安全的内容”,我必须手动取消阻止它才能工作。Chrome 控制台报错如下:

Mixed Content: The page at 'https://example.com/mainpage/' was loaded over HTTPS, but requested an insecure resource 'http://example.com/shellinabox/'. This request has been blocked; the content must be served over HTTPS.
Run Code Online (Sandbox Code Playgroud)

我对此感到困惑,因为显然我的 HTML 代码嵌入了example.com/shellinabox. 而且,当我https://example.com/shellinabox直接访问时,锁定图标是绿色的,没有被阻止,并且该页面上没有任何 SSL 问题的迹象。

我还在 Firefox、IE 和 MS edge 中对此进行了测试,它们都具有相同的行为(因此这不是 Chrome 特定的问题)。是什么赋予了?

html https iframe mixed-content

3
推荐指数
2
解决办法
6299
查看次数

标签 统计

html ×1

https ×1

iframe ×1

mixed-content ×1