标签:info because resource Transpor app later NSAppTransportSecurity security your
Transport security is provided in iOS 9.0 or later, and in OS X v10.11 and later. by default only https calls only allowed in apps. To turn off App Transport Security add following lines in info.plist file.
adding some key in info.plist:
Open Project target's info.plist file
Added a Key called NSAppTransportSecurity as a Dictionary.
Added a Subkey called NSAllowsArbitraryLoads as Boolean and set its value to YES.
Clean the Project and Now Everything is Running fine as like before.
or
add the source code of info.list below:
Xml代码 收藏代码
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>yourdomain.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
using NSAllowsArbitraryLoads = true in the project's info.plist allows all connection to any server to be insecure. If you want to make sure only a specific domain is accessible through an insecure connection, try this:
Xml代码 收藏代码
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>domain.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
this is from offcial documents describe below:
NSAppTransportSecurity
NSAppTransportSecurity (Dictionary - iOS, macOS) Use this key to describe your app’s intended HTTP connection behavior if you require exceptions from best security practices or you want to enable new security features.
On Apple platforms, a networking security feature called App Transport Security (ATS) is available to apps and app extensions, and is enabled by default. It improves privacy and data integrity by ensuring your app’s network connections employ only industry-standard protocols and ciphers without known weaknesses. This helps instill user trust that your app does not accidentally leak transmitted data to malicious parties.
By configuring this key’s value in your app’s Info.plist file, you can customize the security of your network connections in a variety of ways. You can:
Allow insecure communication with particular servers
Allow insecure loads for web views or for media, while maintaining ATS protections elsewhere in your app
Enable new security features such as Certificate Transparency
The NSAppTransportSecurity key is supported in iOS 9.0 and later and in macOS 10.11 and later, and is available in both apps and app extensions.
Starting in iOS 10.0 and later and in macOS 10.12 and later, the following subkeys are supported:
NSAllowsArbitraryLoadsForMedia
NSAllowsArbitraryLoadsInWebContent
NSRequiresCertificateTransparency
NSAllowsLocalNetworking
Note: There are two “allows arbitrary loads” keys and they employ different naming patterns. Take care to use …ForMedia and …InWebContent correctly.
标签:info,because,resource,Transpor,app,later,NSAppTransportSecurity,security,your
来源: https://www.cnblogs.com/diruizhixia/p/15212141.html
本站声明:
1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。