混合内容,Content-Security-Policy 和 hash-source

Mixed Content , Content-Security-Policy and hash-source

我想在 HTTPS 页面中打开 HTTP Iframe。当然这通常是不可能的,因为它会触发 'mixed-content' 违规。

有什么方法可以 by-pass 使用 "Content-Security-Policy" 和哈希源的混合内容块吗?

示例:

这行得通吗?有没有其他方法可以做到这一点。

注意:否 upgrade-insecure-requests 将不起作用,因为该页面是导航请求并且必须从 HTTP 提供框架。

不,现代浏览器无法绕过安全块(从 Firefox 23、Chrome 14、IE9 开始)

Thankfully, most modern browsers block this type of dangerous content by default

参考:https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content#mixed-content-types--security-threats-associated

如果服务器将 csp child-src 设置为 http://mysite/my-frame.html 怎么办?当我阅读定义时,它应该可以工作。

child-src lists the URLs for workers and embedded frame contents. For example: child-src https://youtube.com would enable embedding videos from YouTube but not from other origins. Use this in place of the deprecated frame-src directive.

https://www.html5rocks.com/en/tutorials/security/content-security-policy/