title: CFNetwork SSLHandshake failed (-9824) NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)
body: <p>I am sending a post request using the following code in iOS 9 to a https server</p>
  
  <pre><code>[NSURLConnection sendSynchronousRequest:request returningResponse:&amp;requestResponse error:&amp;err];  
  </code></pre>
  
  <p>But I get the following error  </p>
  
  <pre><code>CFNetwork SSLHandshake failed (-9824)
  NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)
  </code></pre>
  
  <p>I have tried adding the exception to info.plist as follows:</p>
  
  <pre><code>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;  
  &lt;dict&gt;
      &lt;key&gt;NSExceptionDomains&lt;/key&gt;
      &lt;dict&gt;
      &lt;key&gt;www.myserver.com&lt;/key&gt;
      &lt;dict&gt;
      &lt;key&gt;NSIncludesSubdomains&lt;/key&gt;
      &lt;true/&gt;
      &lt;key&gt;NSTemporaryExceptionAllowsInsecureHTTPLoads&lt;/key&gt;
      &lt;true/&gt;
      &lt;key&gt;NSTemporaryExceptionMinimumTLSVersion&lt;/key&gt;
      &lt;string&gt;TLSv1.1&lt;/string&gt;
  &lt;/dict&gt;
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
     &lt;dict&gt;
       &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;
       &lt;true/&gt;
     &lt;/dict&gt;
  </code></pre>
  
  <p>It works on a real device but not on a simulator</p>