title: iOS downloading tar file from https url
body: <p>I'm attempting to download a file from an https url. It works fine using http, but it just won't do it for https. I will post my current code below, but for personal purposes I don't want to release the ip address used for the URL, so in it's place I'll put "ipAddress". I should mention that the https is from a self-signed cert.</p>
  
  <pre><code>-(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]]];
  
  }
  </code></pre>
  
  <p>I've tried numerous things other things, from using the NSURLConnection to downloading entire libraries, but I must be missing something. I also have:</p>
  
  <pre><code>- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge{
  
  }
  </code></pre>
  
  <p>In my app delegate .m file as mentioned in other files. Any help would be appreciated, and if you need additional information, please let me know in the comments.</p>