Ios5 iOS正在从https url下载tar文件

Ios5 iOS正在从https url下载tar文件,ios5,https,download,nsurlconnection,Ios5,Https,Download,Nsurlconnection,我正在尝试从https url下载文件。使用http可以很好地工作,但对于https则不行。我将在下面发布我的当前代码,但出于个人目的,我不想发布用于URL的ip地址,因此我将在此处放置“ipAddress”。我应该提到https来自自签名证书 -(void)downloadPDF: (NSInteger)numDay { NSString *homeDir = NSHomeDirectory(); NSString *filePath = [NSString stringWithForma

我正在尝试从https url下载文件。使用http可以很好地工作,但对于https则不行。我将在下面发布我的当前代码,但出于个人目的,我不想发布用于URL的ip地址,因此我将在此处放置“ipAddress”。我应该提到https来自自签名证书

-(void)downloadPDF: (NSInteger)numDay {

NSString *homeDir = NSHomeDirectory();

NSString *filePath = [NSString stringWithFormat: @"%@/%@%@%@", homeDir, @"Documents/", @"File", @".tar"];
NSString *dirPath = [NSString stringWithFormat: @"%@/%@", homeDir, @"Documents/"];
    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", @"ipAddress", @'File", @".tar"]];

NSData *urlData = [NSData dataWithContentsOfURL:url];
[urlData writeToFile:filePath atomically:YES];
[mywebview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:filePath]]];

}
我尝试了很多其他的方法,从使用NSURLConnection到下载整个库,但我肯定错过了一些东西。我还有:

- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge{

}

在我的应用程序delegate.m文件中,如其他文件中所述。任何帮助都将不胜感激,如果您需要其他信息,请在评论中告诉我。

https需要完全限定的域地址(FQDA)。它不适用于IP。

这是否仅适用于iOS?我可以从浏览器下载有问题的项目,甚至在我的iPad上。这是一种https。ssl证书中嵌入了FQDN,因此如果您指向的url不匹配,它应该会失败。