App Transport Security has blocked a cleartext HTTP 报错解决办法

2020-02-16 19:13:25

报错原因是ios开发,现在提倡使用https了,但是我开发阶段如何处理呢。

Xcode 7 创建新项目用到 UIWebView 发送请求时,报下面的错:

“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”

找查资料后发现,新特性要求App内访问网络请求,要采用 HTTPS 协议。

最终找到以下解决办法:

1、在Info.plist中添加 NSAppTransportSecurity 类型 Dictionary ;

2、在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 类型Boolean ,值设为 YES;



  • 2021-04-19 11:36:44

    iOS 组件实现方案

    什么才是好架构,为什么要组件,组件设计的优点

  • 2021-04-25 09:53:18

    android debug速度特别慢有时候卡住

    一直提示定在 Starting LLDB server。可能的原因是 Android Studio编译速度太慢了,就会一直卡在Starting LLDB server。可以通过设置 Run/Debug Configurations ——> Debugger ——> Debug type 为 Java 跳过 C/C++的调试,起码实现对 Java 程序的调试

  • 2021-04-25 09:54:19

    sequelize 时区配置

    sequelize 默认情况下, 保存日期时会转换成 +00:00时区,