最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Tips on loading external css and javascript over https - Stack Overflow

programmeradmin0浏览0评论

When setting up a site to run over https:// is there a way to stop the page from blocking any external css or javascript loaded from standard http://.

Some of the external files are under the same domain, so could be called via https://, but some are from another domain that has no secure connection available.

When setting up a site to run over https:// is there a way to stop the page from blocking any external css or javascript loaded from standard http://.

Some of the external files are under the same domain, so could be called via https://, but some are from another domain that has no secure connection available.

Share Improve this question edited Jan 14, 2013 at 11:24 Piotr 5,5631 gold badge34 silver badges37 bronze badges asked Jan 14, 2013 at 11:17 Strontium_99Strontium_99 1,8136 gold badges33 silver badges54 bronze badges 1
  • 1 Just make sure everything is over SSL. There is a reason it would not load or at least warn the user you know. – PeeHaa Commented Jan 14, 2013 at 11:21
Add a ment  | 

2 Answers 2

Reset to default 6

There shouldn't be. Such security measures are in place for good reason.

Even if you could remove them, doing so would be a very bad idea.

A man-in-the-middle attack would allow the JS or CSS (which can have embedded JS via various browser extensions) to be substituted.

This would allow an attacker to run any JS they liked on the page.

That JS could grab any data from the page and send it to the attacker.

The page would not be secure.

Copy the assets somewhere that you can access them over HTTPS.

You can rewrite your links without using scheme (like "//example./styles/mystyle.css").

See this questions for details

In case some external content is unavailable via HTTPS, you can make a HTTPS proxy on your server (with some sort of caching and ACL if you like).

发布评论

评论列表(0)

  1. 暂无评论