Fork me on GitHub

何为“Secure Contexts”安全内容? 终于说明白了!

​​​何为“Secure Contexts”安全内容? 终于说明白了!

 

 

看图说话

 

 

【途径1】:地址栏输入: edge://flags/

按需设置选项后,重启浏览器即可。

 

 

Allow invalid certificates for resources loaded from localhost.

Allows requests to localhost over HTTPS even when an invalid certificate is presented. – Mac, Windows, Linux

#allow-insecure-localhost                   

选项:已禁用                   已启用       

         

Block insecure private network requests.

Prevents non-secure contexts from making sub-resource requests to more-private IP addresses. An IP address IP1 is more private than IP2 if 1) IP1 is localhost and IP2 is not, or 2) IP1 is private and IP2 is public. This is a first step towards full enforcement of CORS-RFC1918: https://wicg.github.io/cors-rfc1918 – Mac, Windows, Linux

#block-insecure-private-network-requests                     

选项:Default Enabled Disabled            

                                          

Insecure origins treated as secure

Treat given (insecure) origins as secure origins. Multiple origins can be supplied as a comma-separated list. Origins must have their protocol specified e.g. "http://example.com".

选项: 已禁用                   已启用

 

【途径2】:关闭 “windows defender smartscreen”

edge浏览器显示站点不安全:
1、打开浏览器,点击右上角的三个点。

2、在任务栏中点击“设置”。

3、点击左侧任务栏的“隐私和安全性”。

4、下拉到底,将“windows defender smartscreen”关闭即可。

【途径3】

使用启动命令参数:

edge.exe --user-data-dir=/test/only/profile/dir --unsafely-treat-insecure-origin-as-secure="http://example.com"

 

其它设置

Chrome设置--disable-web-security解决跨域问题

 

IE设置里的显示混合内容

默认是提示。安全和不安全内容或混合内容表示某个网页试图同时使用安全 (HTTPS/SSL) 和不安全 (HTTP) Web 服务器连接来显示元素。这通常在显示来自不安全的服务器的图像、横幅或脚本的在线商店或金融站点上出现。显示混合内容的风险在于,不安全网页或脚本可能能够访问安全内容中的信息。

windows10/7/8操作系统在组策略中设置IE浏览器显示混合内容。电脑“运行”–“cmd”打开组策略,或者在c:\windows\system32中找到gpedit.msc文件打开即可。

找到对应选项:IE浏览器显示混合内容即可根据自己的需要设置已启用、已禁用或者未设置。

该策略可以对应生效处理的内容为:

\Windows组件\InternetExplorer\Internet控制面板\安全页\受信任的站点区域。设置成功后,注销计算机重新进入桌面即可生效。

 

 

 

开发人员本地调试,谨慎操作。

参考:Secure Contexts (w3c.github.io):https://w3c.github.io/webappsec-secure-contexts/​​​​

posted @ 2021-07-20 15:47  优爱酷  阅读(1096)  评论(0编辑  收藏  举报