title: NSURLErrorDomain Code=-1012 The operation couldn’t be completed
body: <p>I am getting the following error when running my code from the xcode.    </p>
  
  <blockquote>
    <p>Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x17166b740
    {NSErrorFailingURLStringKey=<a href="https://..../move/resource/v1/user/me/activity/summary?start_date=2015-01-21&amp;end_date=2015-01-14&amp;detail=true" rel="noreferrer">https://..../move/resource/v1/user/me/activity/summary?start_date=2015-01-21&amp;end_date=2015-01-14&amp;detail=true</a>,
    NSUnderlyingError=0x17405b630 "The operation couldn’t be completed.
    (kCFErrorDomainCFNetwork error -1012.)",
    NSErrorFailingURLKey=<a href="https://..../move/resource/v1/user/me/activity/summary?start_date=2015-01-21&amp;end_date=2015-01-14&amp;detail=true" rel="noreferrer">https://..../move/resource/v1/user/me/activity/summary?start_date=2015-01-21&amp;end_date=2015-01-14&amp;detail=true</a>}</p>
  </blockquote>
  
  <p>Here is my Code </p>
  
  <pre><code>  NSString *urlSummaryString = [[NSString stringWithFormat: @"%@summary?start_date=%@&amp;end_date=%@&amp;detail=true", kMisfitCloudEndpoint, strStartDate,strEndDate] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  
      __block NSMutableDictionary *responseDict = [NSMutableDictionary dictionary];
      __block NSError *error = nil;
      NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlSummaryString] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0];
      [request setValue:@"access_token" forHTTPHeaderField:self.misfitAccessToken];
      [request setHTTPMethod:@"GET"];
      [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
          if(connectionError){
              // Handle the connection error
              return ;
          }}];
  </code></pre>
  
  <p>Can any one help me what is wrong here. Is it something related to SSL Certificate on the server and is related to the security. When I use CocoaRestClient to make my request it works perfectly.</p>
  
  <p>Can some body explain me in detail what cause this problem or if any body can have the solution for this. I have to use <code>[NSURLConnection sendAsynchronousRequest]</code> method. I am using <code>Xcode</code> 6.1 and <code>ios</code> 8.1.2</p>