亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

關于AppTransportSecurity的更新,中英文對照--Xcode7--iOS9

2019-11-14 18:18:16
字體:
來源:轉載
供稿:網友

章節都為本人定義,無抄襲,其中英文部分內容為官方文檔摘抄以及自己總結,翻譯的不好,敬請指正

App Transport Security(暫且翻譯為app傳輸安全)

What is ATS?

App Transport Security (ATS) enforces best PRactices in the secure connections between an app and its back end. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt; it is also on by default in iOS 9 and OS X v10.11. You should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one.

ATS為app應用和后臺之間的安全連接提供了一個很好地規范,ATS阻止了額外的消息泄露,提供了安全規范的行為,并且很容易采用。同時最早提供在iOS 9 和 OS X v10.11之間的交互中。開發者應該盡快的采用ATS,無論是創建還是更新app。

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. In addition, your communication through higher-level APIs needs to be encrypted using TLS version 1.2 with forward secrecy. If you try to make a connection that doesn‘t follow this requirement, an error is thrown. If your app needs to make a request to an insecure domain, you have to specify this domain in your app‘s Info.plist file

如果你正在開發一個新的應用,你應該只用HTTPS協議。如果你已經有一個app,你應該現在就盡可能地用HTTPS,并且有計劃地盡快改動剩下的部分。另外通過高等級API進行的通信需要用 采用forward secrecy的TLS 1.2進行編碼。如果你試著建立一個不符合標準的連接,將會拋出錯誤。如果你的app需要向一個不可靠的域發送請求,你必須在你的plist文件里指定這個域。

ATS requirements:

       All connections using the NSURLConnectionCFURL, or NSURLsession APIs use App Transport Security default behavior in apps built for iOS 9.0 or later, and OS X 10.11 or later. Connections that do not follow the requirements will fail. 

所有用到 NSURLConnectionCFURL 或者 NSURLSession 的 API在iOS9.0或者OS X 10.00 以后的版本都用ATS的標準行為進行編譯. 沒有滿足ATS要求的連接將會失敗。

       These are the App Transport Security requirements: 

滿足ATS需要下列要求:

  • The server must support at least Transport Layer Security (TLS) protocol version 1.2.     必須是TLS協議1.2之后的版本

  • Connection ciphers are limited to those that provide forward secrecy (see the list of ciphers below.)   必須是提供forward secrecy的連接加密(查看后面的可通過的加密規則)

  • Certificates must be signed using a SHA256 or greater signature hash algorithm, with either a 2048 bit or greater RSA key or a 256 bit or greater Elliptic-Curve (ECC) key.

    Invalid certificates result in a hard failure and no connection.   證書必須是用SHA256或者更好的簽名hash算法,可以用一個2048bit key或者 RSA key 或者 ECCkey

These are the accepted ciphers:

  • TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384

  • TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256

  • TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384

  • TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA

  • TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256

  • TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA

  • TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384

  • TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

  • TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384

  • TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256

  • TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA

If your connect not apply to the requirements, you will get the error followed:

如果連接不滿足要求,將會報下列錯誤:

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

 

How to set ATS with HTTPS not apply to ATS? (設置不滿足要求的HTTPS協議)

<key>NSAPPTransportSecurity</key>	<dict>		<key>NSExceptionDomains</key>		<dict>			<key>api.circletable.com</key>			<dict>				<key>NSIncludesSubdomains</key>                <true/>				<key>NSExceptionRequiresForwardSecrecy</key>   <false/>                                <key>NSExceptionAllowsInsecureHTTPLoads</key>  <true/>			</dict>		</dict>	</dict>

 

NSIncludesSubdomains設置為YES表示子級域名和父級域名都使用相同設置。

NSExceptionRequiresForwardSecrecy為NO 如果當前HTTPS不支持ForwardSecrecy,屏蔽掉改功能。

NSExceptionAllowInsecureHTTPLoads設置為YES,則表示允許訪問沒有證書或者是自簽名、過期、主機名不匹配的證書引發的錯誤的域名。

 

 

How and when to disable ATS?(什么時候不使用ATS,怎樣取消ATS)

在iOS 9下直接用http請求會收到如下錯誤

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app‘s Info.plist file.

如果需要支持Http,需要在info.plist中添加字段:

<key>NSAppTransportSecurity</key><dict>    <key>NSAllowsArbitraryLoads</key>    <true/></dict>

NSAllowsAritraryLoads部分表示禁用ATS

 

The property keys(可設置的屬性)

 

KeysType

NSAppTransportSecurity

Dictionary

    NSAllowsArbitraryLoads

Boolean

    NSExceptionDomains

Dictionary

        <domain-name-for-exception-as-string>

Dictionary

            NSExceptionMinimumTLSVersion

String

            NSExceptionRequiresForwardSecrecy

Boolean

            NSExceptionAllowsInsecureHTTPLoads

Boolean

            NSIncludesSubdomains

Boolean

            NSThirdPartyExceptionMinimumTLSVersion

String

            NSThirdPartyExceptionRequiresForwardSecrecy

Boolean

            NSThirdPartyExceptionAllowsInsecureHTTPLoads

Boolean

 

NSAppTransportSecurity

A dictionary containing the settings for overriding default App Transport Security behaviors. The top level key for the app’s Info.plist file.

一個用于重寫ATS標準行為的字典,里面包含ATS的設置。在app的plist文件里是頂級設置目錄

NSAllowsArbitraryLoads

A Boolean value used to disable App Transport Security for any domains not listed in the NSExceptionDomains dictionary. Listed domains use the settings specified for that domain.The default value of NO requires the default App Transport Security behavior for all connections.

一個布爾值,對于任何沒有在NSExceptionDomains的字典里添加的域,可以用這個值來禁用ATS。 默認值為NO,表示所有連接都需要采用ATS標準

NSExceptionDomains

A dictionary of App Transport Security exceptions for specific domains. Each key is a string containing the domain name for the exceptions.

存放特殊ATS的字典,每個鍵值是一個包含特殊域名的字符串

<domain-name-for-exception-as-string>

A dictionary of exceptions for the named domain. The name of the key is the name of the domain–for example, www.apple.com.

存放特殊域的字典,鍵值是域名

NSExceptionMinimumTLSVersion

 A string that specifies a the minimum TLS version for connections. Valid values are:TLS v1.0, TLS v1.1, TLS v1.2.

TLSV1.2 is the default value.

一個為連接最小TLS版本號的字符串。有效的值是TLSv1.0, TLSv1.1, TLSv1.2. 默認的值是TLS v1.2

NSExceptionRequiresForwardSecrecy

A Boolean value for overriding the requirement that the domain support forward secrecy using ciphers.

YES is the default value and limits the ciphers to those shown in Default Behavior.

Setting the value to NO adds the following the list of accepted ciphers:

  • TLS_RSA_WITH_AES_256_GCM_SHA384

  • TLS_RSA_WITH_AES_128_GCM_SHA256

  • TLS_RSA_WITH_AES_256_CBC_SHA256

  • TLS_RSA_WITH_AES_256_CBC_SHA

  • TLS_RSA_WITH_AES_128_CBC_SHA256

  • TLS_RSA_WITH_AES_128_CBC_SHA

 

NSExceptionAllowsInsecureHTTPLoads

A Boolean value for overriding the requirement that all connections use HTTPS. Use this key to access domains with no certificate, or with an error for a self-signed, expired, or hostname-mismatch certificate.

NO is the default value.

NSIncludesSubdomains

A Boolean value for applying the overrides to all subdomains of the top-level domain.

NO is the default value.

NSThirdPartyExceptionMinimumTLSVersion

A version of NSExceptionMinimumTLSVersion used when the domain is an app service that is not controlled by the developer.

NSThirdPartyExceptionRequiresForwardSecrecy

A version of NSExceptionRequiresForwardSecrecy used when the domain is an app service that is not controlled by the developer.

NSThirdPartyExceptionAllowsInsecureHTTPLoads

A version of NSExceptionAllowsInsecureHTTPLoads used when the domain is an app service that is not controlled by the developer.

Reference

http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/

http://www.neglectedpotential.com/2015/06/working-with-apples-application-transport-security/

https://developer.apple.com/library/prerelease/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS9.html

https://developer.apple.com/library/prerelease/ios/releasenotes/DeveloperTools/RN-Xcode/Chapters/xc7_release_notes.html


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
国产欧美日韩高清| 海角国产乱辈乱精品视频| 日日噜噜噜夜夜爽亚洲精品| 亚洲精品资源美女情侣酒店| 久久人人爽国产| 亚洲精品一区中文字幕乱码| 97国产精品免费视频| 欲色天天网综合久久| 色无极亚洲影院| 精品动漫一区二区| 九九精品在线观看| 国产一区视频在线播放| 国产精品中文久久久久久久| 亚洲国产成人精品一区二区| 日韩av在线网站| 欧美国产一区二区三区| 色yeye香蕉凹凸一区二区av| 国产美女扒开尿口久久久| 欧美极品少妇xxxxx| 中文字幕欧美视频在线| 国产精品日日做人人爱| 91国产美女在线观看| 国产精品高潮呻吟久久av无限| 成人自拍性视频| 久久精品一本久久99精品| 国产精品高潮呻吟视频| 宅男66日本亚洲欧美视频| 欧美精品videossex88| 91精品啪在线观看麻豆免费| 国产精品亚洲精品| 精品国产一区二区三区久久| 日韩日本欧美亚洲| 中文字幕日韩精品在线观看| 欧美黑人又粗大| 亚洲精品中文字幕有码专区| 色综合天天综合网国产成人网| 亚洲直播在线一区| 国产精品日韩久久久久| 亚洲成人精品久久| 日韩中文综合网| 国产伦精品免费视频| 国产精品视频一| 亚洲激情自拍图| 亚洲一区制服诱惑| 国产精品福利网| 久久久中精品2020中文| 久久久久999| 国产一区二区久久精品| 亚洲成人教育av| 色综合久久久888| 欧洲精品在线视频| 成人在线一区二区| 热久久视久久精品18亚洲精品| 国产精品吹潮在线观看| 川上优av一区二区线观看| 国内精品免费午夜毛片| 亚洲国产婷婷香蕉久久久久久| 日本一本a高清免费不卡| 亚洲性av在线| 欧美丰满老妇厨房牲生活| 日韩在线观看免费网站| 97热在线精品视频在线观看| 插插插亚洲综合网| 国产成人亚洲综合91精品| 欧美日韩中国免费专区在线看| 欧美激情精品久久久久久免费印度| 欧美成人手机在线| 国产成人精品国内自产拍免费看| 俺去了亚洲欧美日韩| 国产成人免费av电影| 深夜精品寂寞黄网站在线观看| 成人在线激情视频| 97久久久久久| 亚洲自拍偷拍网址| 国产精品第七十二页| 日韩视频在线免费| 日韩三级影视基地| 亚洲女成人图区| 日韩专区中文字幕| 亚洲高清在线观看| 国产亚洲一区二区精品| 国产国语videosex另类| 久久亚洲综合国产精品99麻豆精品福利| 美女福利视频一区| 久久男人资源视频| 中文字幕一区日韩电影| 欧美孕妇与黑人孕交| 国产精品久久久久av免费| 国产精品自产拍在线观| 久久精品国产96久久久香蕉| 亚洲老板91色精品久久| 亚洲a级在线播放观看| 欧美极品少妇xxxxⅹ裸体艺术| 亚洲女人被黑人巨大进入| 日韩一区二区精品视频| 亚洲第一国产精品| 精品成人国产在线观看男人呻吟| 国产不卡一区二区在线播放| 欧美激情精品久久久久久黑人| 日韩免费电影在线观看| 成人欧美在线观看| 国产精品高潮呻吟久久av黑人| 久久久久久中文字幕| 亚洲男人的天堂在线播放| 欧美精品在线看| 亚洲欧美综合v| 欧美精品一区二区三区国产精品| www.久久久久久.com| 亚洲成人av在线播放| 青青草国产精品一区二区| 久精品免费视频| 亚洲欧美在线一区| 国产欧美日韩中文字幕在线| 精品视频久久久| 国产精品久久久久福利| 97国产在线观看| 丝袜亚洲另类欧美重口| 久久久久久免费精品| www.欧美视频| 亚洲欧美综合v| 日韩av电影手机在线观看| 欧美极品美女视频网站在线观看免费| 久久久久久亚洲精品| 日韩少妇与小伙激情| 国产一区二区三区在线观看网站| 色偷偷噜噜噜亚洲男人的天堂| 国产精品ⅴa在线观看h| 亚洲精品中文字幕av| 一区二区三区美女xx视频| 国产精品夜间视频香蕉| 国产精品福利片| 欧美精品18videos性欧| 性色av一区二区三区在线观看| 久久久这里只有精品视频| 中文字幕亚洲综合| 日本精品久久久久影院| 欧美日本高清视频| 青青草国产精品一区二区| 成人免费在线网址| 亚洲性视频网址| 久久亚洲国产成人| 亚洲欧美日韩精品久久奇米色影视| 日韩高清不卡av| 精品久久久久久久久久| 国产91精品在线播放| 国产精品久久久久久久久| 欧美日本黄视频| 欧美日韩精品在线观看| 在线看片第一页欧美| 国产亚洲精品va在线观看| 91po在线观看91精品国产性色| 欧美激情视频在线观看| 色与欲影视天天看综合网| 国产日本欧美视频| 日韩av片免费在线观看| 亚洲精品电影在线观看| 成人精品久久av网站| 国产在线精品自拍| 一区二区三区无码高清视频| 久久久久久国产免费| 欧美精品亚州精品| 国产精品第一视频| 91久久在线观看| 九九热视频这里只有精品|