The scarecrow's blog

No heart, No lung!

设置Xcode7|iOS9 与服务器交互支支持HTTP

在iOS9中,苹果将原http协议改成了https协议,使用TLS1.2 SSL加密请求数据

解决方法

在info.plist中添加

1
2
3
4
5
6
7
8
9
10
11
12
<plist>

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

</plist>