且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS9收到错误“发生了ssl错误,无法与服务器建立安全连接”

更新时间:2022-02-08 21:28:58

对于iOS9,Apple做出了一个激进的决定iOS 9,禁用来自iOS应用程序的所有不安全的HTTP流量,作为应用传输安全(ATS)

For the iOS9, Apple made a radical decision with iOS 9, disabling all unsecured HTTP traffic from iOS apps, as a part of App Transport Security (ATS).

要简单地禁用ATS,您可以通过打开 Info.plist 来执行此步骤>,并添加以下行:

To simply disable ATS, you can follow this steps by open Info.plist, and add the following lines:

<key>NSAppTransportSecurity</key>
  <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
  </dict>