HSTS (HTTP Strict Transport Security)

HSTS HTTP Strict Transport Security

網站可以選擇使用HSTS策略,來讓瀏覽器強制使用HTTPS與網站進行通信

手動(強制) 讓HSTS失效

一、於網址列中輸入:

chrome://net-internals/#hsts

二、在下方Query domain的區域中的文字格輸入查詢的域名,然後按「Query」

三、在Delete domain中輸入要清除 HSTS 設定的域名,然後按「Delete」。

四、 再 Query domain 的區域中的文字格輸入查詢的域名,再查一次。

下方出現Not found 的提示,表示成功刪除。

五、[APACHE] Centos7,8設定 HSTS ( HTTP Strict Transport Security )

http://sfs.tw/content/index/15373

1.檢查有無「headers_module」
apachectl -M | grep 'header'

 headers_module (shared)

2.# vi /etc/httpd/conf/httpd.conf

在尾端加入

Header always set Strict-Transport-Security "max-age=31536000;includeSubdomains; preload"


3.測試

# curl -s -D- https://lychee.com.tw/ | grep -i Strict
Strict-Transport-Security: max-age=3153600;includeSubdomains; preload