在安装配置 SSL 证书时,可使用一种能使数据传输更加安全的Web安全协议,即在服务器端上开启 HSTS
(HTTP Strict Transport Security)。它告诉浏览器只能经过HTTPS访问,而绝对禁止HTTP方式。 web
HTTP Strict Transport Security (HSTS) is an opt-in security enhancement that is specified by a web application through the use of a special response header. Once a supported browser receives this header that browser will prevent any communications from being sent over HTTP to the specified domain and will instead send all communications over HTTPS. It also prevents HTTPS click through prompts on browsers.chrome
可是,在平常开发的过程当中,有时咱们会想测试页面在 HTTP 链接中的表现状况,这时 HSTS 的存在会让调试不能方便的进行下去。并且因为 HSTS 并非像 cookie 同样存放在浏览器缓存里,简单的清空浏览器缓存操做并无什么效果,页面依然经过 HTTPS 的方式传输。 那么怎样才能关闭浏览器的 HSTS 呢,各类谷歌浏览器
以后,在这里汇总一下几大常见浏览器 HSTS 的关闭方法。缓存
~/Library/Cookies/HSTS.plist
这个文件chrome://net-internals/#hsts
Delete domain
中输入项目的域名,并 Delete
删除Query domain
测试是否删除成功和 Chrome 方法同样安全
about:permissions
Forget About This Site
内容转自:http://www.tuicool.com/articles/QbYBne服务器