[11] [[応答]]の [DFN[[RUBYB[HTTPS状態]@en[HTTPS state]]]]は、
当該[[応答]]の[[輸送路]]となった [[HTTPS]] ([[HTTP]] over [[TLS]])
の安全性に関する[[利用者エージェント]]の判断を表します。

* 仕様書

[REFS[
- [9] '''[CITE@en-US[Fetch Standard]] ([TIME[2015-09-03 20:55:08 +09:00]] 版) <https://fetch.spec.whatwg.org/#concept-response-https-state>'''
- [19] [CITE@en-US[Fetch Standard]] ([TIME[2015-09-03 20:55:08 +09:00]] 版) <https://fetch.spec.whatwg.org/#concept-basic-fetch>
- [17] [CITE@en-US[Fetch Standard]] ([TIME[2015-09-03 20:55:08 +09:00]] 版) <https://fetch.spec.whatwg.org/#concept-http-network-fetch>
- [21] [CITE@en-US[Fetch Standard]] ([TIME[2015-09-03 20:55:08 +09:00]] 版) <https://fetch.spec.whatwg.org/#dom-response>
- [44] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-11-06 03:51:21 +09:00]] 版) <https://html.spec.whatwg.org/#concept-document-https-state>
- [38] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-09-29 22:07:19 +09:00]] 版) <https://html.spec.whatwg.org/#https-state>
- [24] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-09-29 22:07:19 +09:00]] 版) <https://html.spec.whatwg.org/#concept-workerglobalscope-https-state>
- [52] [CITE@en[Service Workers Nightly]] ([TIME[2017-02-16 20:10:49 +09:00]]) <https://w3c.github.io/ServiceWorker/#dfn-https-state>
]REFS]

* 意味

[10] [[応答]] [SRC[>>9]]、[[環境設定群オブジェクト]] [SRC[>>38]]、
[CODE(DOMi)@en[[[Document]]]] [SRC[>>44]]、
[CODE(DOMi)@en[[[WorkerGlobalScope]]]] [SRC[>>24]]、
[[サービスワーカー]]の[F[スクリプト資源]] [SRC[>>52]]
は、 [DFN[[F[[RUBYB[[[HTTPS状態]]]@en[HTTPS state]]]]]]を持ちます。

[36] その値は [CODE[[[none]]]], [CODE[[[deprecated]]]], [CODE[[[modern]]]]
のいずれかです [SRC[>>9, >>38, >>35, >>24]]。既定値は [CODE[none][HTTPS state]] です 
[SRC[>>9, >>35, >>24, >>52]]。

[15] [[HTTPS]]でない[[輸送路]]の[[応答]]では、 [DFN[[CODE[[[none]]]]]]
となります。

[12] 通常の [[HTTPS]] 上の[[応答]]では、 [DFN[[CODE[[[modern]]]]]]
となります [SRC[>>9]]。

[13] 移行期間にあると[[利用者エージェント]]が判断した場合は、
[DFN[[CODE[[[deprecated]]]]]] となります [SRC[>>9]]。

[EG[
[14] 使われている[[ハッシュ関数]]が削除されつつある場合、
弱い [[cipher suite]] の場合、
[[内部名]]の[[証明書]]の場合、
極端に長い[[有効期間]]を持つ[[証明書]]の場合などに使えます [SRC[>>9]]。
]EG]

;; [16] 具体的に何が [CODE[[[deprecated]]]] となるかは、
仕様上は規定されていません。一般的にはこれは[[相互運用性]]の問題を生じさせるように思えますが、
[[セキュリティー]]は[[相互運用性]]より重要と考えられており、
また中長期的には [CODE[[[deprecated]]]] なものはやがて未対応に置き換えられてゆく 
(ので[[ネットワークエラー]]扱いになる) ため、標準化になじまないのでしょう。

[23] [[環境設定群オブジェクト]]の[[HTTPS状態]]は、
その関連付けられている[[資源]]の配送に使われた[[通信路]]の保安特性を表します [SRC[>>38]]。
実際には対応する[[大域オブジェクト]]の [[HTTPS状態]]となります。

[37] [CODE(DOMi)@en[[[Document]]]] の[[HTTPS状態]]は、
その[[文書]]の配送に使われた[[通信路]]の保安特性を表します [SRC[>>44]]。

[39] [CODE(DOMi)@en[[[WorkerGlobalScope]]]] の[[HTTPS状態]]は、
[[ワーカー]]の[[スクリプト]]の配送に使われた[[通信路]]の保安特性を表します。

[40] [[navigate]] で作られた[[文書]]や [[run a worker]] で作られた[[大域オブジェクト]]には、
作成に使った[[応答]]の [[HTTPS状態]]がコピーされます。

[41] [CODE(JS)@en[[[document.open]]]] ([[overridden reload]]) や [CODE(HTMLa)@en[[[srcdoc]]]]
では、呼び出し元の [[HTTPS状態]]がコピーされます。

;; 詳しくはそれぞれの項を参照。

[56] [[文脈的保安]]か否かの判断では、 [CODE[deprecated]] かどうかが検査されます。

[58] 
[[Does [VAR[settings]] prohibit mixed security contexts?]]
で [CODE[none]] かどうかが検査されます。

[59] 
[[Should [VAR[response]] to [VAR[request]] be blocked as mixed content?]]
で [CODE[modern]] かどうかが検査されます。

* 処理

[20] [[basic fetch]] は、
[[basic fetch]] が直接[[応答]]を作成する場合について、
[[応答]]の[[HTTPS状態]]を[[要求のクライアント]]の[[HTTPS状態]]と同じに設定します
[SRC[>>19]]。

[18] [[HTTP-network fetch]] は、 [[HTTPS]] からの[[応答]]について、
[[HTTPS状態]]を [CODE[[[modern]]]] または [CODE[[[deprecated]]]]
に設定します [SRC[>>17]]。

[22] [CODE(DOMi)@en[[[Response]]]] [[コンストラクター]]は、
[[HTTPS状態]]を[[入口設定群オブジェクト]]の[[HTTPS状態]]と同じに設定します
[SRC[>>21]]。

* 文脈

[47] [CODE(HTMLa)@en[[[ping]]]] [[属性]]の処理に影響します。

[57] [[非認証済応答]]かどうかの判断に影響します。

* 利用者インターフェイス

[60] 
多くの
[[Webブラウザー]]は[[アドレスバー]]に
[[HTTPS状態]]に相当する情報を表示します。
[SEE[ [[アドレスバー]] ]]

* 関連

[48] [[HTTPS状態]]は、旧来の[[仕様書]]の曖昧な用語「[[保安輸送路]]」
をより明確に規定したものと考えることもできます。

[25] [[insecure origin]]、[[insecure URL]] は、定義で[[応答]]の [[HTTPS状態]]を参照しています。

[26] [[Mixed Content]] の可否の判定は、[[環境設定群オブジェクト]]や[[応答]]の
[[HTTPS状態]]を参照しています。

* 歴史

[1] [CITE@en[Introduce authentication state https://www.w3.org/Bugs/Public/show_bug.c... · 6fdb71b · whatwg/fetch]]
( ([TIME[2014-10-30 03:01:53 +09:00]] 版))
<https://github.com/whatwg/fetch/commit/6fdb71b61e8e78efe3e28ff66787dd437a0077e7>

[2] [CITE@en[MIX: Convert checks to environment settings objects. · d065309 · w3c/webappsec]]
( ([TIME[2014-10-30 03:03:29 +09:00]] 版))
<https://github.com/w3c/webappsec/commit/d06530978dafbd99881ca74f93ed67d720b161da>

[3] [CITE@en[Authentication state -> TLS state · b81881d · whatwg/fetch]]
( ([TIME[2014-11-01 03:35:25 +09:00]] 版))
<https://github.com/whatwg/fetch/commit/b81881daad0ab1343ae2b265d9345cdfaf56288e>

[4] [CITE@en[MIX: s/authentication state/TLS state/g · 8372db0 · w3c/webappsec]]
( ([TIME[2014-11-01 03:35:44 +09:00]] 版))
<https://github.com/w3c/webappsec/commit/8372db04445a26ca4b93053d4127b4581eca37ce>

[5] [CITE@en[Rename TLS state to HTTPS state to avoid confusion with OE. · whatwg/fetch@7022094]] ([TIME[2015-04-09 23:41:19 +09:00]] 版) <https://github.com/whatwg/fetch/commit/7022094593d63c599b521270e684461739cb0f57>

[6] [CITE@en[Re: CfC: Mixed Content to PR; deadline July 6th.]]
([[Mike West]] 著, [TIME[2015-07-06 23:51:33 +09:00]] 版)
<https://lists.w3.org/Archives/Public/public-webappsec/2015Jul/0037.html>

[7] [CITE@en[MIX: Drop 'deprecated TLS-protection'. · w3c/webappsec@2fa9d67]]
([TIME[2015-07-07 11:54:18 +09:00]] 版)
<https://github.com/w3c/webappsec/commit/2fa9d6757123cd3e4d53a347ba8bc57437c5d292>

[8] [CITE@en[Rename HTTPS state one last time. Give examples for "deprecated". Fix… · whatwg/fetch@ee99e4a]]
([TIME[2015-07-28 12:09:57 +09:00]] 版)
<https://github.com/whatwg/fetch/commit/ee99e4aaf597a0647f35b0db34aaee7f05862713>

[FIG(quote)[
[FIGCAPTION[
[27] [CITE[IRC logs: freenode / #whatwg / 20150909]]
([TIME[2015-09-10 11:20:49 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20150909>
]FIGCAPTION]

> 
> # '''['''13:36''']''' <annevk> OE ruined the term TLS for me
> # '''['''13:43''']''' <mkwst> Yup. Totally understood.
> # '''['''13:48''']''' <Ms2ger> OE?
> # '''['''13:48''']''' <mkwst> opportunistic encryption

]FIG]


[28] [CITE@en[MIX: HTTPS state update. · w3c/webappsec@06ac637]]
([TIME[2015-09-10 11:30:17 +09:00]] 版)
<https://github.com/w3c/webappsec/commit/06ac637d5768b1a8af9db89dc42d814f7eb84942>

[29] [CITE@en[SECURE: HTTPS state update. · w3c/webappsec@ef42844]]
([TIME[2015-09-10 11:30:26 +09:00]] 版)
<https://github.com/w3c/webappsec/commit/ef42844de9cedc7e53da863ccca72f2721a214e3>

[30] [CITE[IRC logs: freenode / #whatwg / 20150922]]
([TIME[2015-09-23 13:33:34 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20150922>

[31] [CITE@en[27147 – Expose HTTPS state on responses]]
([TIME[2015-09-23 13:34:07 +09:00]] 版)
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=27147>

[32] [CITE@en[SECURE: Drop the flag on the environment settings object. · w3c/webappsec@90210b3]]
([TIME[2015-09-25 19:06:09 +09:00]] 版)
<https://github.com/w3c/webappsec/commit/90210b3ae0e70408cb6a8640d3a647f610630502>

[33] [CITE@en[xref HTTPS state · whatwg/fetch@21dee64]]
([TIME[2015-09-27 14:21:45 +09:00]] 版)
<https://github.com/whatwg/fetch/commit/21dee646c93b2e7aada1bfb638b18e0bd7697588>

[34] [CITE@en[Add 'HTTPS state' to settings objects · whatwg/html@6de5241]] ([TIME[2015-09-29 23:41:32 +09:00]] 版) <https://github.com/whatwg/html/commit/6de524157fcf341e10efb3eec634bcf7325e6ee4>

[42] [CITE@en[Add a note about HTTPS state. · w3c/webappsec-secure-contexts@a9603f8]]
([TIME[2015-10-22 11:48:14 +09:00]] 版)
<https://github.com/w3c/webappsec-secure-contexts/commit/a9603f8acbc701963555ba1b94eae935ebbb196c>

[43] [CITE[IRC logs: freenode / #whatwg / 20151105]]
([TIME[2015-11-06 17:56:01 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20151105>

- [35] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-09-29 22:07:19 +09:00]] 版) <https://html.spec.whatwg.org/#concept-window-https-state>

[45] [CITE@en[Move 'HTTPS state' from Window to Document · whatwg/html@68390ce]] ([TIME[2015-11-06 23:26:26 +09:00]] 版) <https://github.com/whatwg/html/commit/68390cea99f9f19881a16e1c8adaf1b130b4d1cc>

[46] [CITE@en[Use the HTTPS state concept instead of "encrypted connection" · whatwg/html@1ee3316]]
([TIME[2016-02-25 14:07:27 +09:00]] 版)
<https://github.com/whatwg/html/commit/1ee3316caa1a5754f7bbd29c494842785f9a181b>

[49] [CITE@en[Editorial: make an HTTPS state value its own thing]]
( ([[annevk]]著, [TIME[2016-05-04 20:49:34 +09:00]]))
<https://github.com/whatwg/fetch/commit/3ac01569802d8a7338d73df2675d8cded97ae748>

[50] [CITE@en[Define HTTPS state in terms of Fetch's HTTPS state value]]
( ([[annevk]]著, [TIME[2016-05-05 03:31:57 +09:00]]))
<https://github.com/whatwg/html/commit/3828d49503284ff790c993f1c9218b4d982cfe75>

[FIG(quote)[
[FIGCAPTION[
[51] [CITE@en-US[Firefox for iOS Makes it Faster and Easier to Use the Mobile Web the Way You Want | The Mozilla Blog]]
( ([TIME[2016-05-22 01:22:18 +09:00]]))
<https://blog.mozilla.org/blog/2016/05/11/firefox-for-ios-makes-it-faster-and-easier-to-use-the-mobile-web-the-way-you-want/>
]FIGCAPTION]

> With iOS, you can now temporarily ignore these error messages for websites you have deemed as “safe”, but that might register as potentially unsafe by Firefox.

]FIG]


[53] [CITE@en[Stop hardcoding the list of schemes that inherit HTTPS state · Issue #255 · whatwg/fetch]]
([TIME[2017-05-09 16:59:38 +09:00]])
<https://github.com/whatwg/fetch/issues/255>

[54] [CITE@en[Drop "TLS Protected" in favor of HTTPS state.]]
([[mikewest]]著, [TIME[2018-10-23 01:55:54 +09:00]])
<https://github.com/w3c/webappsec-referrer-policy/commit/cd3894ac6bdc097abed1b8584d8e96bb0fca00ec>

[55] [CITE@en["TLS-protected" link seems not very useful · Issue #82 · w3c/webappsec-referrer-policy]]
([TIME[2018-11-06 16:13:46 +09:00]])
<https://github.com/w3c/webappsec-referrer-policy/issues/82>