传输安全性阻止了明文HTTP

编程入门 行业动态 更新时间:2024-10-27 16:26:56
本文介绍了传输安全性阻止了明文HTTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要在 info.plist 中设置什么设置以根据以下错误消息启用HTTP模式?

What setting do I need to put in my info.plist to enable HTTP mode as per the following error message?

传输安全性已阻止明文HTTP(http://)资源加载,因为它不安全。临时例外可以通过您的应用的Info.plist文件进行配置。

Transport security has blocked a cleartext HTTP () resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

假设我的域名 example 。

推荐答案

如果您使用的是Xcode 8.0和Swift 3.0或Swift 2.2甚至是Objective C:

If you are using Xcode 8.0 and Swift 3.0 or Swift 2.2 or even Objective C:

<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSExceptionDomains</key> <dict> <key>example</key> <dict> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSIncludesSubdomains</key> <true/> </dict> </dict> </dict>

更多推荐

传输安全性阻止了明文HTTP

本文发布于:2023-10-09 16:55:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1476252.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:明文   安全性   HTTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!