title: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) error in https connection
body: <p>In iOS 9, I am  hitting a request for the url <a href="https://s3.amazonaws.com/furniture.retailcatalog.us/products/2061/6262u9665.jpg" rel="nofollow noreferrer">https://s3.amazonaws.com/furniture.retailcatalog.us/products/2061/6262u9665.jpg</a> using basic NSURLConnection.</p>
  
  <pre><code>NSOperationQueue *completionQueue = [NSOperationQueue mainQueue];
      NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
      self.mURLSession = [NSURLSession sessionWithConfiguration:configuration delegate:nil delegateQueue:completionQueue];
  
      NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://s3.amazonaws.com/furniture.retailcatalog.us/products/2061/6262u9665.jpg"]];
      NSURLSessionDataTask *dataTask = [self.mURLSession dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
          NSLog(@"%@",error);
      }];
      [dataTask resume];
  </code></pre>
  
  <p>But getting this error</p>
  
  <p>Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSUnderlyingError=0x7c1075e0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorCodeKey=-9802, _kCFStreamErrorDomainKey=3, kCFStreamPropertySSLPeerTrust=, kCFStreamPropertySSLPeerCertificates={type = immutable, count = 3, values = (
      0 : 
      1 : 
      2 : 
  )}}}, _kCFStreamErrorCodeKey=-9802, NSErrorFailingURLStringKey=<a href="https://s3.amazonaws.com/furniture.retailcatalog.us/products/2061/6262u9665.jpg" rel="nofollow noreferrer">https://s3.amazonaws.com/furniture.retailcatalog.us/products/2061/6262u9665.jpg</a>, NSErrorPeerCertificateChainKey={type = immutable, count = 3, values = (
      0 : 
      1 : 
      2 : 
  )}, NSErrorClientCertificateStateKey=0, NSURLErrorFailingURLPeerTrustErrorKey=, NSErrorFailingURLKey=<a href="https://s3.amazonaws.com/furniture.retailcatalog.us/products/2061/6262u9665.jpg" rel="nofollow noreferrer">https://s3.amazonaws.com/furniture.retailcatalog.us/products/2061/6262u9665.jpg</a>}</p>
  
  <p>Even though this is https connection,why am I getting this strange error. Can anyone please let me know.</p>