今天遇到一個反饋,在一臺iPhone上,加載我們的https頁面的時候,總是加載失敗,錯誤信息提示“證書失效,正在嘗試連接到xxx的服務器”。
- 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 “xxxxxxx” which could put your confidential information at risk."
但是其他機器都沒問題,排除各種可能性也沒找到原因。
最後上網找到了原因:
http://stackoverflow.com/questions/4861103/https-request-on-old-iphone-3g
果然,我們那臺出問題的機器上時間被設置爲1974年,改爲正常時間之後就沒有任何問題了。
後來問了下服務端人員,說除了時間不對的情況下,還有一些其他情況也會導致SSL失敗,最典型的就是使用了代理服務器。