title: App Transport Security - Error Domain=NSURLErrorDomain Code=-1200
body: <p>I have come across this 1200 error whilst building a POC and I'm really stuck as to what the actual problem is. Before you read this, I'm not looking for work arounds as I have already implemented a work around, I want to properly fix this issue.</p>
  
  <p>In my app I am making a @POST HTTP request, the code for the request is fine and I make my request, get some json, parse and do whatever with it.</p>
  
  <p>When building the app I was using CharlesProxy as a middleman so I could see the request I was sending out (as my password field wasn't getting encoded properly). After I built the POC I closes Charles and then the app stopped working. </p>
  
  <p>I got these error logs in my console:</p>
  
  <pre><code>error : Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made."
  </code></pre>
  
  <p>I googled around for a fix and people seemed to suggest disabing transport security to prevent apple from interfering. The thing is the server I am interacting with is a HTTPS server and transport security is not picking up on this.</p>
  
  <p>I've read that this is due to an error with the SSL handshake but nobody actually suggested any fixes.</p>
  
  <p>For now I've changed the app transport security settings in my info.plist to allow arbitrary loads. Obviously I don't want to be doing this in my main app, I would like to know of a way to fix this once and for all! (and I can also run charles proxy alongside the app to get everything to work).</p>