Domain = NSURLErrorDomain代码1202 [英] Domain=NSURLErrorDomain Code 1202

查看:1835
本文介绍了Domain = NSURLErrorDomain代码1202的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我收到以下错误:


错误域= NSURLErrorDomain代码= -1202 \此服务器的证书无效您可能正在连接到假装为server-prod.name-cloud.com的服务器,这可能会使您的机密信息处于危险之中。\\UserInfo = {NSErrorFailingURLStringKey = https://server-prod.name-cloud.com / v3 / project / session / 926B9E6BE31B /,NSLocalizedRecoverySuggestion =你想连接吗?无论如何到服务器?,_ kCFStreamErrorDomainKey = 3,NSErrorFailingURLKey = https://server-prod.name-cloud.com / v3 / project / session / 926B9E6BE31B /,_ kCFStreamErrorCodeKey = -9843,NSLocalizedDescription =此服务器的证书无效。您可能连接到假装为server-prod.name-cloud.com的服务器,这可能会使您的机密信息面临风险。}

Error Domain=NSURLErrorDomain Code=-1202 \"The certificate for this server is invalid. You might be connecting to a server that is pretending to be "server-prod.name-cloud.com" which could put your confidential information at risk.\" UserInfo={NSErrorFailingURLStringKey=https://server-prod.name-cloud.com /v3/project/session/926B9E6BE31B/, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorFailingURLKey=https://server-prod.name-cloud.com /v3/project/session/926B9E6BE31B/, _kCFStreamErrorCodeKey=-9843, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be "server-prod.name-cloud.com" which could put your confidential information at risk.}

我阅读了所有相关文档,我们将所有要求应用于常见故障部分。

I read all the relevant docs, we apply all the requirements in "Common Failures" section.

更多详细信息:


  • 仅从德国收到的错误(过去2W中来自意大利的4次除外)

  • 内部无法复制

  • 最终经过多次重试后,上传内容将被抛弃

  • 这是在iOS 10.xx& 9.xx

  • 我使用amazon服务器 2016-08 SSL安全策略
    所以根据苹果它应该没问题

  • the errors received only from Germany(except 4 times in the past 2W that was from Italy)
  • It is not reproducible in house
  • Eventually after tons of retries the uploads go throw
  • This was received booth in iOS 10.x.x & 9.x.x
  • I use amazon servers with 2016-08 SSL Security Policies, so according to apple it should be OK

在我使用的应用程序中:

In the app I use:

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

注意 - 在生产中我总是使用HTTP,我留下NSAllowsArbitraryLoads因为一些海外测试人员可以切换路径到HTTP进行调试。

note - in production I always use HTTP’s, I leave the NSAllowsArbitraryLoads because some testers offshore can switch the rout to HTTP for debugging.

推荐答案

对于在本地使用服务器且需要让iOS模拟器信任的开发人员证书。请按照以下步骤操作:

For the devs who are working with a server locally and need to get the iOS Simulator to trust the certificate. Follow the steps below:


  1. 通过导出获取 .cer 文件钥匙扣证书。您需要有效格式的证书文件,并且最容易通过
    从钥匙串导出它。

  1. Get the .cer file by exporting the certificate from the Keychain. You need the certificate file in a valid format and its easiest to get this by exporting it from the Keychain.

拖放前面提到的 .cer 文件到模拟器上。它应该提示您安装配置文件。请继续按照说明进行安装。

Drag and drop the aforementioned .cer file onto the simulator. It should give you a prompt on installing a "Profile". Go ahead and follow the instructions to install it.

对于那些使用最新版本的XCode和iOS模拟器的人。你需要做最后一步。必须明确告知模拟器信任根CA.通过转到常规 - >来完成此操作关于 - >证书信任设置 - > 为您的特定证书启用根证书的完全信任

For those who are working with the latest versions of XCode and iOS Simulator. You need to do 1 last step. The Simulator must be explicitly told to trust the root CA. Do this by going to General -> About -> Certificate Trust Settings -> "Enable Full Trust for Root Certificate" for your particular certificate

希望这可以节省有些人头疼!

Hopefully, this saves headaches for some people!

这篇关于Domain = NSURLErrorDomain代码1202的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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