【问题标题】:NSURLerrordomain error -1202 Using AppceleratorNSURLerrordomain 错误 -1202 使用 Appcelerator
【发布时间】:2016-03-01 14:04:17
【问题描述】:

我正在使用 Appcelerator 开发 iPhone 应用程序。应用程序中的每一件事都运行良好。但现在其中显示了一个警报。

【问题讨论】:

  • 您是否使用Ti.Network.HTTPClient 或任何使用互联网访问的API 或模块?是否有任何您知道可能包含无效证书的 https URL?

标签: ios appcelerator appcelerator-titanium


【解决方案1】:

快速的 google 搜索应该会将您带到错误代码列表 (https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Constants/index.html#//apple_ref/doc/constant_group/URL_Loading_System_Error_Codes)

在这里,我们可以找到以下内容

NSURLErrorServerCertificateUntrusted = -1202

表示服务器证书似乎有问题。

快速搜索此错误为我们提供了可能的原因:

手机时间可能不对

(One of my iPhone users gets an NSURLErrorServerCertificateUntrusted error)

编辑

我没有使用 appcelerator 的经验。此解决方法仅适用于本机,但是,想法应该是相同的。

如果您使用的是 NSUrlConnection,还有一个解决方法:

利用了

NSUrlConnection -connection:didReceiveAuthenticationChallenge:

HTTPS with NSURLConnection - NSURLErrorServerCertificateUntrusted

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-05-04
    • 2014-11-11
    • 1970-01-01
    • 2022-07-25
    • 2017-12-04
    • 1970-01-01
    • 2013-12-30
    • 1970-01-01
    相关资源
    最近更新 更多