【问题标题】:Is it possible to access http content on https site?是否可以访问 https 站点上的 http 内容?
【发布时间】:2020-07-07 12:07:25
【问题描述】:

我在 HTTPS 服务器上托管了我的网站,并且我正在使用 HTTP 中的第三方 API。

我认为,在 HTTPS 站点中使用 HTTP 内容会产生问题并给出如下错误:

Mixed Content: The page at 'https://actionmap.prospectmapping.se/Plans/plan-details?planId=a48a49b0-a64b-4eda-9215-a02b6645c743' was loaded over HTTPS, but requested an insecure stylesheet 'http://js.api.here.com/v3/3.0/mapsjs-ui.css'. This request has been blocked; the content must be served over HTTPS.

如果我想在 HTTPS 站点中访问 HTTP API,谁能建议我该怎么做。

谢谢!

【问题讨论】:

    标签: security https


    【解决方案1】:

    可以通过 CSP 标头(内容安全策略)或浏览器本身(我认为在 21 世纪应该是这种情况)来阻止混合内容。玩得开心,在不同的浏览器中玩一会儿https://googlesamples.github.io/web-fundamentals/fundamentals/security/prevent-mixed-content/simple-example.html

    如果用户代理本身不允许混合内容,您将无能为力。阻止混合内容是为了保护最终用户。

    请随时阅读https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content 了解更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-14
      • 2015-02-23
      • 2013-10-26
      • 1970-01-01
      • 2012-12-19
      • 2012-01-17
      • 1970-01-01
      • 2023-02-07
      相关资源
      最近更新 更多