我已经测试了该includesubdomain
指令,结果是它只影响主机域和主机域的子域。
例如,如果您使用 访问网站https://echo.local.io
,并使用 查询 hsts/pkp chrome://net-internals/#hsts
:
echo.local.io
使用(主机域)查询 HSTS/PKP 域
Found:
static_sts_domain:
static_upgrade_mode: UNKNOWN
static_sts_include_subdomains:
static_sts_observed:
static_pkp_domain:
static_pkp_include_subdomains:
static_pkp_observed:
static_spki_hashes:
dynamic_sts_domain: echo.local.io
dynamic_upgrade_mode: FORCE_HTTPS
dynamic_sts_include_subdomains: true
dynamic_sts_observed: 1634294710.318108
dynamic_sts_expiry: 1650019510.318091
使用另一个子域查询 HSTS/PKP 域foo.local.io
(与主机域相同级别)
Not found
使用根域local.io
(宿主域的父域)查询 HSTS/PKP 域
Not found
buzz.echo.local.io
用子域(主机主的子域)查询HSTS/PKP域
Found:
static_sts_domain:
static_upgrade_mode: UNKNOWN
static_sts_include_subdomains:
static_sts_observed:
static_pkp_domain:
static_pkp_include_subdomains:
static_pkp_observed:
static_spki_hashes:
dynamic_sts_domain: echo.local.io
dynamic_upgrade_mode: FORCE_HTTPS
dynamic_sts_include_subdomains: true
dynamic_sts_observed: 1634298549.210941
dynamic_sts_expiry: 1650023349.210936
另见:https ://blog.codefarm.me/2021/10/15/http-strict-transport-security/#test-subdomain-with-echo-local-io