[5] [DFN[App Transport Security]] ([DFN[ATS]]) は、 [[iOSアプリ]]において[[素のHTTP]]
の接続を拒否し専ら [[HTTPS]] を使うことを求めるものです。

* 背景

[9] [[素のHTTPを取り巻く脅威]]が重大に捉えられるようになり、 [[Web]]
のみならず[[ネイティブアプリ]]でも [[HTTPS]] への移行が急務であるとして、
[[Apple]] が [[iOS]] に導入したのが [[ATS]] です。

* HSTS と ATS

[6] [[HTTP]] における [[HSTS]] と [[ATS]] は、名前と趣旨は似ていますが、
動作は全く異なります。

[7] [[HSTS]] は、[[Webサイト]]の[[著者]]が、自サイトへの [[HTTP]]
アクセスを禁止し、 [[HTTPS]] に自動的に[[リダイレクト]]するよう
[[Webブラウザー]]に求めるものです。

[8] [[ATS]] は、[[iOS]] が[[アプリ]]の [[HTTP]] アクセスを原則として禁止するもので、
[[アプリ]]の開発者が [[iOS]] 側に例外的に認める [[HTTP]] アクセスを指示できるというものです。
[[HSTS]] よりも [[ATS]] の方がかなり強力な制約となっています。

* 歴史

[FIG(quote)[
[FIGCAPTION[
[1] [CITE@en[iOS 9.0]]
([TIME[2015-06-14 12:10:37 +09:00]] 版)
<https://developer.apple.com/library/prerelease/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS9.html#//apple_ref/doc/uid/TP40016198-DontLinkElementID_13>
]FIGCAPTION]

> App Transport Security (ATS) lets an app add a declaration to its Info.plist file that specifies the domains with which it needs secure communication. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt. You should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one.
> If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible.
> 

]FIG]


[2] [CITE@ja[【追記】iOS9でHTTP通信がSSL通信になるのを防ぐ方法]]
([TIME[2015-06-14 12:11:45 +09:00]] 版)
<http://nlogic.jp/?p=412>

[FIG(quote)[
[FIGCAPTION[
[3] [CITE@en[App Transport Security Technote: App Transport Security Technote]]
([TIME[2015-09-04 13:25:14 +09:00]] 版)
<https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/>
]FIGCAPTION]

> App Transport Security is a feature that improves the security of connections between an app and web services. The feature consists of default connection requirements that conform to best practices for secure connections. Apps can override this default behavior and turn off transport security.

]FIG]


[FIG(quote)[
[FIGCAPTION[
[4] [CITE@en[【Apple WWDC 2016】iOS 10のApp Transport Securityと2016年末からのATS必須化についてAppleのエンジニアに聞いてきた - Hatena Developer Blog]]
( ([TIME[2016-06-17 09:29:15 +09:00]]))
<http://developer.hatenastaff.com/entry/2016/06/16/165924>
]FIGCAPTION]

> iOS 9では従来通り、NSAllowsArbitraryLoads が YES であれば、自由にhttp通信が行えます。
> iOS 10では、まず NSAllowsArbitraryLoadsInWebContent が YES かどうかで条件が別れます。NSAllowsArbitraryLoadsInWebContent が、設定されていないか NO である場合は、iOS9と同じ挙動になります。 YES に設定されている場合は、iOS 10では NSAllowsArbitraryLoads が無視され、WKWebViewのみがhttp通信を許されるようになります。
> このとき、データ通信を行うNSURLSessionに加え、UIWebViewについてもhttp通信が許可されないのがポイントです。なるべくWKWebViewを利用して欲しいとのことでした。また、NSExceptionDomains を設定すれば、指定したドメインへのNSURLSessionやUIWebViewからのhttp通信も許可されるそうです。

]FIG]

[10] [CITE@ja[Apple、HTTPSを必須にする「ATSサポート」義務付けを延期 | スラド セキュリティ]]
([TIME[2016-12-27 15:40:51 +09:00]])
<https://security.srad.jp/story/16/12/26/0516206/>