iOS9 - HTTP连接错误 [英] iOS9 - HTTP Connection Error

查看:176
本文介绍了iOS9 - HTTP连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新我的Xcode时遇到3个错误



1- App Transport Security阻止了明文HTTP(http://)资源加载是不安全的。可以通过应用的Info.plist文件配置临时例外。



2- CFNetwork SSLHandshake失败(-9824)



3- NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9824)



I试过:



< pre class =snippet-code-html lang-html prettyprint-override> < key> NSAppTransportSecurity< / key>< dict> <密钥GT; NSExceptionDomains< /密钥GT; <字典> <密钥GT; yourdomain.com< /密钥GT; <字典> <! - 包括允许子域名 - > <密钥GT; NSIncludesSubdomains< /密钥GT; <真/> <! - 包括允许HTTP请求 - > <密钥GT; NSTemporaryExceptionAllowsInsecureHTTPLoads< /密钥GT; <真/> <! - 包括指定最小TLS版本 - > <密钥GT; NSTemporaryExceptionMinimumTLSVersion< /密钥GT; <串GT; TLSv1.1< /串GT; < /字典> < / dict>< / dict>





 < key> NSAppTransportSecurity< / key> <字典> <密钥GT; NSAllowsArbitraryLoads< /密钥GT;<真/> < / dict>  



但它们无效。有人可以帮我吗!谢谢。

解决方案

从Project Navigator中单击项目名称。



现在,在右侧,您将看到项目的常规选项卡。选择信息Tab

展开海关iOS目标属性

添加新类型,将其命名为NSAppTransportSecurity,键入为Dictionary.It将在此文本中转换App Transport Security Settings

在里面添加一个新项目并将其命名为NSAllowsArbitraryLoads ,键入布尔值,价值是。



在论坛上查看此主题以获取更多详细信息... ... b $ b添加info.plist的条目



https://forums.developer.apple.com/message/5857#5857



请参阅WWDC上的Session 711。
https://developer.apple.com/videos/wwdc/ 2015 /?id = 711


I got 3 error when i update my Xcode

1- 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.

2- CFNetwork SSLHandshake failed (-9824)

3- NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)

I tried:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>yourdomain.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>

and

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

But they didn't work. Can anyone help me please! Thank You.

解决方案

From Project Navigator click your project's name.

Now, on the right side you' ll see the General Tab of your project.Select the Info Tab Expand the Customs iOS Target Properties Add a new type, Name it as NSAppTransportSecurity, type as Dictionary.It will be convert in this text App Transport Security Settings Inside that add a new item and name it as NSAllowsArbitraryLoads, type as Boolean, value YES.

See this thread on the forums for the further details what apple... Add the entry to info.plist

https://forums.developer.apple.com/message/5857#5857

And refer to Session 711 at WWDC. https://developer.apple.com/videos/wwdc/2015/?id=711

这篇关于iOS9 - HTTP连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆