How to allow http content within an iframe on a https site

后端 未结 10 1553
我寻月下人不归
我寻月下人不归 2020-11-22 14:06

I load some HTML into an iframe but when a file referenced is using http, not https, I get the following error:

[blocked] The page at {current_pagenam

10条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 14:32

    Based on generality of this question, I think, that you'll need to setup your own HTTPS proxy on some server online. Do the following steps:

    • Prepare your proxy server - install IIS, Apache
    • Get valid SSL certificate to avoid security errors (free from startssl.com for example)
    • Write a wrapper, which will download insecure content (how to below)
    • From your site/app get https://yourproxy.com/?page=http://insecurepage.com

    If you simply download remote site content via file_get_contents or similiar, you can still have insecure links to content. You'll have to find them with regex and also replace. Images are hard to solve, but Ï found workaround here: http://foundationphp.com/tutorials/image_proxy.php

提交回复
热议问题