title: Error 1012 when using SSL in AFNetworking 2.0
body: <p>I'm trying to connect with SSL to my website which is using a certificated signed by StartSSL. When I browse to the website, everything is working fine, however, when I try to use SSL in the app, I get:</p>
  
  <pre><code>Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x8d635f0 {NSErrorFailingURLKey=https://edutoets.nl/API/login.php, NSErrorFailingURLStringKey=https://edutoets.nl/API/login.php}
  </code></pre>
  
  <p>I've included the certificate in .cer format (after converting it from .crt to .cer with openssl) in the app bundle and AFNetworking can find it. Here's my code that creates the security policy of the manager:</p>
  
  <pre><code>- (AFSecurityPolicy*) sslSecurityPolicy
  {
      NSString *cerPath = [[NSBundle mainBundle] pathForResource:@"edutoets" ofType:@"cer"];
      NSData *certData = [NSData dataWithContentsOfFile:cerPath];
      AFSecurityPolicy *securityPolicy = [[AFSecurityPolicy alloc] init];
      [securityPolicy setAllowInvalidCertificates:NO];
      [securityPolicy setPinnedCertificates:@[certData]];
      [securityPolicy setSSLPinningMode:AFSSLPinningModeCertificate];
  
      return securityPolicy;
  }
  </code></pre>
  
  <p>And here I set the security policy and execute the request:</p>
  
  <pre><code>AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager;
  [manager setSecurityPolicy:[self dodyrwSecurityPolicy]];
  manager.responseSerializer = [AFJSONResponseSerializer serializer];
  [manager POST:kLoginURL parameters:... success:...];
  </code></pre>
  
  <p>I don't know what I'm doing wrong here. The .cer file looks fine (the certificate corresponds to the certificate when browsing to the website). This is happening on the iOS simulator.</p>
  
  <p>Could anyone help me with this?</p>