如何使用 Apple Transport Security 保护 HTTPS .m4v URL

How to secure a HTTPS .m4v URL using Apple Transport Security

我在 iOS 应用程序中使用单个 https 静态 URL。我想使用 ATS 来保护它。我很困惑应该在 .plist 文件中使用哪个异常。

1-NSIncludesSubdomains 2-NSExceptionAllowsInsecureHTTPLoads 3-NSExceptionRequiresForwardSecrecy 4-NSExceptionMinimumTLSVersion 5-NSThirdPartyExceptionAllowsInsecureHTTPLoads 6-NSThirdPartyExceptionRequiresForwardSecrecy 7-NSThirdPartyExceptionMinimumTLSVersion

提前致谢

您无需在 ATS 中添加任何标志即可启用安全通信。 ATS 标志用于排除需要 https 通信的域。

确保您使用的 url 以 https 开头,它将安全连接。

现在,您可以执行更高级的操作,例如证书固定,但这不涉及 ATS,我建议使用类似 Alamofire 的工具来帮助正确完成所有配置。