使用Xcode 7.1的iOS 9中的NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9813) [英] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813) in iOS 9 with Xcode 7.1

查看:261
本文介绍了使用Xcode 7.1的iOS 9中的NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9813)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用iOS 9作为目标&使用Xcode 7.1,尝试了所有的ATS最佳解决方案,但没有工作。以下是控制台上的以下错误说明。如果有任何建议,我将有义务。



这里的一些关键事项是 -

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

从备份中排除Main.db时出错Error Domain = NSCocoaErrorDomain Code = 4文件Main.dbdoesn'存在。的UserInfo = {NSURL =文件:///用户/拉吉/库/开发商/ CoreSimulator /设备/ BC3A0589-3B9A-4AFD-8F2A-B1C92FA341DD /数据/容器/数据/应用/ 70B3043A-8553-41E5-A147-8508D08BF3E6 / Documents / Main.db,NSFilePath = / Users / Raj / Library / Developer / CoreSimulator / Devices / BC3A0589-3B9A-4AFD-8F2A-B1C92FA341DD / data / Containers / Data / Application / 70B3043A-8553-41E5-A147-8508D08BF3E6 / Documents /Main.db,NSUnderlyingError = 0x798465c0 {错误域= NSPOSIXErrorDomain代码= 2没有这样的文件或目录}}
2016-08-30 21:09:10.867 GFIM [80653:484899] SFOAuthCredentials:revokeRefreshToken:refresh令牌被撤销。清除identityUrl,instanceUrl,issuedAt fields
2016-08-30 21:09:10.871 GFIM [80653:484899] INFO | 0 | SFPasscodeManager |在注销时重置密码。

SFOAuthCredentials:revokeRefreshToken:刷新令牌已撤销。清除identityUrl,instanceUrl,issuedAt字段

这些可能是问题的原因。

  2016-08-30 21:09:19.095 GFIM [80653:484899] SFOAuthCoordinator:webViewDidStartLoad:host = test.salesforce.com:path = / 
2016-08-30 21:09:19.863 GFIM [80653:484962] NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9813)
2016-08-30 21:09:19.983 GFIM [ 80653:484962] NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9813)
2016-08-30 21:09:20.016 GFIM [80653:484962] NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9813)
2016-08-30 21:09:20.054 GFIM [80653:484962] NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9813)
2016-08-30 21:09:20.194 GFIM [80653:484962] NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9813)
2016-08-30 21:09:20.956 GFIM [80653:484962] NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9813)
2016-08-30 21:09:38.285 GFIM [80653:484899] SFOAuthCoordinator:webView:shouldStartLoadWithRequest:(navType = 1):host = test.salesforce.com:path = /
2016-08-30 21:09:38.311 GFIM [80653:484899] SFOAuthCoordinator:webViewDidStartLoad:host = test.salesforce.com:path = /
2016-08-30 21:09:38.834 GFIM [80653:484899] SFOAuthCoordinator:webView:shouldStartLoadWithRequest:(navType = 1):host = 5-prod--stg.cs30.my.salesforce.com:path = / secur / frontdoor.jsp


解决方案

从iOS 9开始Apple强制使用特定主机发出HTTP请求以实现安全目的。
//也可以在iOS 10上使用Swift 3



为此你需要将NSAppTransportSecurity Dictionary添加到Projet的.plist文件中。然后你的plist看起来如下所示。




I am using iOS 9 as target & using Xcode 7.1, tried everything as my level best for all the solutions of ATS but didn't work. Below is the following error description coming at console. If any suggestion comes I will be obliged.

Some of the key things here are -

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

Error excluding Main.db from backup Error Domain=NSCocoaErrorDomain Code=4 "The file "Main.db" doesn’t exist." UserInfo={NSURL=file:///Users/Raj/Library/Developer/CoreSimulator/Devices/BC3A0589-3B9A-4AFD-8F2A-B1C92FA341DD/data/Containers/Data/Application/70B3043A-8553-41E5-A147-8508D08BF3E6/Documents/Main.db, NSFilePath=/Users/Raj/Library/Developer/CoreSimulator/Devices/BC3A0589-3B9A-4AFD-8F2A-B1C92FA341DD/data/Containers/Data/Application/70B3043A-8553-41E5-A147-8508D08BF3E6/Documents/Main.db, NSUnderlyingError=0x798465c0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
2016-08-30 21:09:10.867 GFIM[80653:484899] SFOAuthCredentials:revokeRefreshToken: refresh token revoked. Cleared identityUrl, instanceUrl, issuedAt fields
2016-08-30 21:09:10.871 GFIM[80653:484899] INFO|0|SFPasscodeManager|Resetting passcode upon logout.

SFOAuthCredentials:revokeRefreshToken: refresh token revoked. Cleared identityUrl, instanceUrl, issuedAt fields

These are the things might be the cause of issue.

2016-08-30 21:09:19.095 GFIM[80653:484899] SFOAuthCoordinator:webViewDidStartLoad: host=test.salesforce.com : path=/
2016-08-30 21:09:19.863 GFIM[80653:484962] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2016-08-30 21:09:19.983 GFIM[80653:484962] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2016-08-30 21:09:20.016 GFIM[80653:484962] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2016-08-30 21:09:20.054 GFIM[80653:484962] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2016-08-30 21:09:20.194 GFIM[80653:484962] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2016-08-30 21:09:20.956 GFIM[80653:484962] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2016-08-30 21:09:38.285 GFIM[80653:484899] SFOAuthCoordinator:webView:shouldStartLoadWithRequest: (navType=1): host=test.salesforce.com : path=/
2016-08-30 21:09:38.311 GFIM[80653:484899] SFOAuthCoordinator:webViewDidStartLoad: host=test.salesforce.com : path=/
2016-08-30 21:09:38.834 GFIM[80653:484899] SFOAuthCoordinator:webView:shouldStartLoadWithRequest: (navType=1): host=5-prod--stg.cs30.my.salesforce.com : path=/secur/frontdoor.jsp

解决方案

From iOS 9 Onwards Apple Enforce To make HTTP Request with Specific Host for Security Purpose. //Also works on iOS 10 with Swift 3

For that you need to Add NSAppTransportSecurity Dictionary into your .plist file of Projet. Then your plist will look something like this as follows.

Tap to see .Plist File Image

Here NSAllowArbitraryLoads basically means Connect to anything (this is probably BAD). Instead this you can add particular Host to be Connect.

这篇关于使用Xcode 7.1的iOS 9中的NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9813)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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