OAuth認証の過程で、リクエストトークンをゲット( https://api.twitter.com/oauth/request_token )しようとしたら、謎エラーが返ってきました。
error=Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “api.twitter.com” which could put your confidential information at risk." UserInfo=0x1fd84610 {NSErrorFailingURLStringKey=https://api.twitter.com/oauth/request_token, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSErrorFailingURLKey=https://api.twitter.com/oauth/request_token, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “api.twitter.com” which could put your confidential information at risk., NSUnderlyingError=0x1fd81c00 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “api.twitter.com” which could put your confidential information at risk.", NSURLErrorFailingURLPeerTrustErrorKey=}
http://answers.yahoo.com/question/index?qid=20111114122711AAamadw
によると、
You might want to make sure your time and date of the ipod is set according to your timezone that could be the problem
なるほど。timezone。
エラーの起きてたiPhoneの設定をみてみると、時刻が1970年1月1日になっていました。
しばらく電池切れだったものを、久しぶりに使ったみたので、時刻がリセットされていたようです。
時刻を今の日時に設定しなおすと、無事エラーは出ませんでした。