在安裝配置 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服務器