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.
Solution
因為iOS 9 有ATS (App Transport Security), 限制了呼叫HTTP都要用HTTPS , 並且使用TLS 1.2認證.
但如果server並沒有支援TLS認證,就需要在appname_info.plist新增如下
這是關閉所有的ATS , 並不建議採用,正確做法應該使用例外的domain,如下列方法.
info.plist
123456789101112131415161718
<key>NSAppTransportSecurity</key><dict><key>NSExceptionDomains</key><dict><key>yourserver.com</key><dict><!--Include to allow subdomains--><key>NSIncludesSubdomains</key><true/><!--Include to allow HTTP requests--><key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key><true/><!--Include to specify minimum TLS version--><key>NSTemporaryExceptionMinimumTLSVersion</key><string>TLSv1.1</string></dict></dict></dict>