旧 iphone 3g 上的 HTTPS 请求
其他任何人在旧 iPhone 上获取 https 请求时遇到问题。
从连接确实失败并出现错误,错误消息如下。
连接错误:错误域=NSURLErrorDomain代码=-1202“该服务器的证书无效。您可能正在连接到一个冒充“www.ourwesbite.co.uk”的服务器,这可能会泄露您的机密信息信息面临风险。”
“我们的网站”有一个有效的证书,而且这个问题不会出现在任何新的 iphone/ipod touch 或 ipad 上,只是最旧的 iphone 上。
在用户单击“确定”到连接错误警报后,登录过程运行良好,从而引发连接错误,从而影响我的登录工作。但问题是它影响了登录后的UI。
所以我很想知道是否还有其他人在使用旧 iPhone 时遇到类似的问题。我的代码没有问题,因为它在模拟器和模拟器上运行得很好。 ipad/4gen iPod touch。
谢谢
Anyone else having issues with getting a https request working on the old iphone.
From connection did fail with error the error message is as follows.
ERROR with theConnection:Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “www.ourwesbite.co.uk” which could put your confidential information at risk."
The "ourwebsite" has a valid certificate and also this problem does not arise in any new iphone/ipod touch or ipads just the oldest iphones.
This is affecting my login from working by throwing a connection error after user clicks ok to the connection error alert the login process runs through fine. But the problem is its affecting the UI after the login.
So pretty much want to know if anyone else is having issues like this with the old iphone. There is no problem with my code as it works perfectly fine on simulator & ipad/4gen ipod touch.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们遇到了此错误,并且相关 iPhone 3g 的日期和时间设置不正确。这意味着所有 SSL 事务都会失败。
我们假设这个 iOS 错误是苹果的问题,而不是我们的问题,因此破解 SSL 证书以使其被忽略并不是解决方案!
We had this error and the iPhone 3g in question had an incorrect date and time set. This meant all SSL transactions would fail.
We assumed that this iOS bug is an apple problem not ours and so hacking the SSL certificate to be ignored is not the solution!
好吧,即使证书有效,它也会抛出错误。因此,使用 NSURLConnection 的以下委托方法解决了这个问题。
当身份验证受到质疑时,它会被调用。下面的代码允许它继续使用 https 连接。
然后,如果感觉不可信,则允许连接通过
Ok so even tho the certificate is valid it will throws the error. So using the following delegate method for NSURLConnection solved this problem.
it gets called when there is a challenge to the authentication. The the following bit of code allow's it to continue with the https connection.
And then that allows the connection through if it feels it is untrusted