title: AFNetworking 3.0 and SSL authentication with setSessionDidReceiveAuthenticationChallengeBlock
body: <p>I'm attempting to migrating from AFNetworking 2.0 to 3.0.</p>
  
  <p>In the previous version I would create an AFHTTPRequestOperation and handle client SSL authentication in another block with setWillSendRequestForAuthenticationChallengeBlock.</p>
  
  <p>For example:</p>
  
  <pre><code>[operation setWillSendRequestForAuthenticationChallengeBlock:^(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge) {
      if ([challenge previousFailureCount] &gt; 0) {
          //this will cause an authentication failure
          [[challenge sender] cancelAuthenticationChallenge:challenge];
          return;
      }
  
      //this is checking the server certificate
      if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
  
          SecTrustResultType result;
          //This takes the serverTrust object and checkes it against your keychain
          SecTrustEvaluate(challenge.protectionSpace.serverTrust, &amp;result);
  </code></pre>
  
  <p>Could someone show me an example of how to do this with AFHTTPSessionManager?  </p>
  
  <p>Do I need to make requests using AFURLSessionManager instead?  I do see a block method there:</p>
  
  <p>(void)setSessionDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block</p>