无法连接到模拟器中以https开头的任何URL

时间:2012-04-16 13:44:33

标签: iphone ipad https nsurlconnection

我目前正在尝试与https网址进行通信。

但每次都失败了。

所以我调用了以下方法并

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 

我在日志中遇到以下错误

Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0xf8830d0 {NSErrorFailingURLStringKey=https://www.google.com/, NSErrorFailingURLKey=https://www.google.com/, NSLocalizedDescription=The request timed out., NSUnderlyingError=0xf882a80 "The request timed out."}

但是当我连接到任何HTTP URL时,我没有收到这些错误。

我也在尝试实现以下两种方法,但它永远不会被称为

- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace


- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge

0 个答案:

没有答案