問題描述
iPod Touch 上的 SSL 證書無效錯誤 ‑ 適用於 iPhone (Invalid SSL Certificate error on iPod Touch ‑ works for iPhone)
我們正在開發一個 iOS 應用程序,它使用 nsurlconnection sendsynchronousrequest 通過 https 連接到服務器
我們在 iPod Touch 3.2 中遇到以下錯誤。但是,完全相同的代碼在 iPhone 3.1 上沒有給出任何錯誤錯誤消息:此服務器的證書無效。您可能正在連接到偽裝成“xx.xx.xxx.xxx”的服務器,這可能會使您的機密信息面臨風險
我們正在嘗試連接到服務器 https: subdomain.domain。 com 和證書實際上只屬於 https: domain.com 這可能是上述不一致的原因嗎?知道為什麼它適用於 iPhone 而不是 iPod Touch。證書由 GoDaddy 簽名。難道是iPod Touch沒有GoDaddy的根證書?
我們需要找到解決這個問題的方法,而不是最好使用私有 API。任何幫助將不勝感激。謝謝。
參考解法
方法 1:
We had almost this exact problem: A certificate error on a particular device running the same code that worked on multiple other devices. It turned out that this had to do with the internal date of the problem device not being current. Our SSL certificate was up to date, but the device was set outside the valid date range. It's worth checking because it could happen to anyone ‑ even the iTunes app reviewer rejected the app for this reason. Luckily we were familiar with the issue, appealed and got a quick approval.
(by Ashutosh Sovani、owise1)