ATS 域异常上的通配符?
Wildcards on ATS Domain exceptions?
在我的生产 Xamarin 应用程序中,我们检索了不同域中 HLS 播放列表的未定义列表。
是否可以在 ATS 异常字典中使用通配符?
我尝试过类似的方法但没有成功:
<key>http://*.domain.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
试试这个:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>domain.com</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
虽然 Apple 强烈建议使用 HTTPS 协议和基于 Internet 的信息的安全通信,但有时这并不总是可行的。例如,如果您正在与第三方网络服务通信或在您的应用中使用互联网投放的广告。
如果您的 Xamarin.iOS 应用必须向不安全的域发出请求,则对您应用的 Info.plist 文件的以下更改将禁用安全默认值ATS 强制执行给定域:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>www.the-domain-name.com</key>
<dict>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
在我的生产 Xamarin 应用程序中,我们检索了不同域中 HLS 播放列表的未定义列表。
是否可以在 ATS 异常字典中使用通配符?
我尝试过类似的方法但没有成功:
<key>http://*.domain.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
试试这个:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>domain.com</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
虽然 Apple 强烈建议使用 HTTPS 协议和基于 Internet 的信息的安全通信,但有时这并不总是可行的。例如,如果您正在与第三方网络服务通信或在您的应用中使用互联网投放的广告。
如果您的 Xamarin.iOS 应用必须向不安全的域发出请求,则对您应用的 Info.plist 文件的以下更改将禁用安全默认值ATS 强制执行给定域:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>www.the-domain-name.com</key>
<dict>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>