今天遇到一个反馈,在一台iPhone上,加载我们的https页面的时候,总是加载失败,错误信息提示“证书失效,正在尝试连接到xxx的服务器”。

 
  
  1. 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失败,最典型的就是使用了代理服务器。