title: UWP app HttpClient HTTPS client certificate problems
body: <p>I'm writing a UWP app in C# that is eventually destined for IoT, but right now I've only been debugging locally. I'm using <code>Windows.Web.Http.HttpClient</code> to connect to a self-hosted WCF REST web service that I've also written and have running as a Console app on the same machine for testing. The service requires mutual authentication with certificates, so I have a CA cert, service cert, and client cert.</p>
  
  <p>My UWP code works like this:</p>
  
  <ol>
  <li>Check app cert store for client cert and CA cert installed. </li>
  <li>If not, install from PFX file and CER file, respectively. </li>
  <li>Attach the <code>Certificate</code> to the <code>HttpBaseProtocolFilter</code> and add the filter to the <code>HttpClient</code></li>
  <li>Call the <code>HttpClient.PostAsync</code></li>
  </ol>
  
  <p>After I call <code>PostAsync</code> I get the following error: <code>An Error Occurred in the Secure Channel Support</code>. After plenty of searching online, and by common sense, I'm pretty sure <code>HttpClient</code> is barfing because of a problem establishing the mutually-authenticated SSL connection. But based on my troubleshooting I can't figure why.</p>
  
  <p>To troublshoot further, I've written a plain old Console app using <code>System.Net.Http.HttpClient</code>, attached the client certificate to the request and everything works great. Sadly, <code>System.Net</code> isn't fully supported on UWP. I've also tried NOT attaching the certificate to the UWP <code>HttpClient</code> and the app prompts me with a UI to select an installed certificate. I select the correct cert and still get the same exception (this at least lets me know the cert is installed correctly and validating properly with the CA from the app's perspective). In additon, I hit the GET on the web service from a browser, select the client cert when prompted, and am able to download a file.</p>
  
  <p>I've tried using Fiddler and, I assume because of the way it proxies traffic, it seems to work a little bit further, except my web service rejects the request as Forbidden (presumably because Fiddler is not including the correct client cert in the request). I haven't hit up Wireshark yet because it's a pain to get Wireshark to work using localhost on Windows.</p>
  
  <p>My next step is to start changing the web service to not require client authentication and see if that is the problem.</p>
  
  <p>Two questions: Why is <code>Windows.Web.Http.HttClient</code> not working in this case? And, less important, any recommendations on good HTTP monitoring tools to help me debug this further?</p>