Cordova应用程序中的HTTP加载失败(kCFStreamErrorDomainSSL,-9813) [英] HTTP load failed (kCFStreamErrorDomainSSL, -9813) in Cordova app

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

问题描述

我使用Cordova 3.2和jquery mobile 1.3创建了一个iOS应用。我使用jquery ajax向RESTfull服务发送请求以检索/更新信息。

I've created an iOS app using Cordova 3.2 and jquery mobile 1.3. I use jquery ajax to send requests to a RESTfull service to retrieve/update information.

我有一些测试设备,各种iPhone,各种不同的iOS版本。在运行iOS 7的iPhone 4S上,当发送任何ajax请求时,我收到以下错误:

I have a number of test devices, various iPhones, with various different iOS versions. On an iPhone 4S, running iOS 7 I receive the following error when any ajax request is sent:

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

这只会发生在这个装置,另一个iPhone 4S, 7,它的工作绝对正常,因为它对我使用的所有其他测试设备。

This only happens on this device, on another iPhone 4S, also running iOS 7, it works absolutely fine, as it does on all of the other test devices I'm using.

我读过这表明证书在某些时候是无效的,这是可以忽略的,为什么会影响一个设备?

I've read that this indicates the certificate is invalid in someway, that being the case, can this be ignored and why would affect on one device?

任何人都可以建议为什么这可能发生,什么可以是不同的设备会阻止它只在我的一个设备上工作。感谢

Can anyone suggest why this might be happening and what could be different about the device that would prevent it from working only on one of my devices. Thanks

推荐答案

如果它在某些设备上工作,而不是其他设备,那么这些设备的证书验证参数会有所不同。这里有一些事情要看:

If it's working on some devices and not others, there's some difference in the certificate validation parameters for those devices. Here are some things to look at:


  1. 快乐的设备有一些根证书,不愉快的设备不?特别是如果他们运行不同的iOS版本,他们可能有不同的受信任的证书列表。尝试前往[设定]> [一般]> [关于] ,然后在底部比较「Trust Store」的数字。查看更多信息此处

  2. 您手动接受了一些中间证书(用于*

  3. 不幸的设备上的日期/时间是否错误?如果它设置为证书到期日期之后或证书颁发日期之前的时间,它将拒绝它。

  1. Do the happy devices have some root certificate that the unhappy devices don't? Particularly if they are running different iOS versions, they may have different lists of trusted certificates as well. Try going to Settings > General > About and compare the numbers for "Trust Store" at the very bottom. See more info here.
  2. Did you manually accept some intermediate certificate (used to sign this certificate) on the happy devices at some point in the past?*
  3. Is the date/time wrong on the unhappy device? If it's set to a time after the certificate expiry date or before the certificate issue date, it will reject it. I'm always shooting myself in the foot with this one!

如果您在不愉快的设备上的浏览器中访问您的终端URL,它给你什么错误? (注意:显然你的服务器会给你一些错误,因为你没有请求正确的标题和参数。我说的是Safari本身,但它应该给出一个更详细的消息,它是什么(它认为)错误的证书。)

If you access your endpoint URL in the browser on the unhappy device, what error does it give you? (Note: obviously your server will give you some error as well because you aren't requesting with the right headers and params. I'm talking about Safari itself, though - it should give a more detailed message about what (it thinks) is wrong with the certificate.)

*编辑以纠正我误解的东西:你有选择接受叶证书如果你去到Safari中的网址,您只能选择接受中间证书(如果您尝试直接加载它们)。

*Edited to correct something I misremembered: you do not have the option to accept the leaf certificate if you go to the URL in Safari, you only have the option to accept intermediate certificates if you attempt to load them directly.

这篇关于Cordova应用程序中的HTTP加载失败(kCFStreamErrorDomainSSL,-9813)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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