title: NSURLConnection with the custom SSL validation
body: <p>I have a question about an extended SSL certificate verification on iOS. The code I have looks as it follows:</p>
  
  <pre><code>- (void) validateAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
  
      if (!someCustomCheck()) { // I do some custom check here
          [paramChallenge.sender cancelAuthenticationChallenge:challenge];
      }
  
      NSURLCredential *credential = [NSURLCredential credentialForTrust:[challenge protectionSpace].serverTrust];
      if (credential) {
          [challenge.sender useCredential:credential forAuthenticationChallenge:challenge];
      }
      else {
          [challenge.sender cancelAuthenticationChallenge:challenge];
      }
  }
  </code></pre>
  
  <p>The tests show me that at this point the normal iOS check for SSL certificate is not happening. Can I assume that if I replace the line:</p>
  
  <pre><code>[challenge.sender useCredential:credential forAuthenticationChallenge:challenge];
  </code></pre>
  
  <p>with </p>
  
  <pre><code>[challenge.sender performDefaultHandlingForAuthenticationChallenge:challenge];
  </code></pre>
  
  <p>so after my custom check I will still have the default system SSL certificate check?</p>
  
  <p>It makes sense from the documentation but many examples which I have seen normally do some custom verification and then call </p>
  
  <pre><code>[challenge.sender useCredential:credential forAuthenticationChallenge:challenge];
  </code></pre>
  
  <p>Thanks.</p>