title: Android Xamarin C#: Https with ServiceStack and self signed certificates
body: <p>So I am changing all my Http webservices to Https using a self signed certificate for testing (for an android app I am making) and it is all working perfectly server side, I know this because I can add the certificate to my PC's certificate store and access the site perfectly, how ever I am having trouble on the client side when it comes to my android app making calls to it.</p>
  
  <p>my Servicestack calls look like this:</p>
  
  <pre><code>        var client = new JsonServiceClient(stubServicesBaseUrl);
  
          return client.Get(new GetLastStatusUpdate()).StatusUpdates.Last();
  </code></pre>
  
  <p>and these used to work when it was only http but since I added code to add the self signed certificate to the android trusted credentials store the calls have stopped working and instead it seems that the request times out.</p>
  
  <pre><code>        byte[] certificate;
          using (var streamReader = new StreamReader(Assets.Open("ScoutTestCert.crt")))
          {
              using (var byteStream = new MemoryStream())
              {
                  streamReader.BaseStream.CopyTo(byteStream);
                  certificate = byteStream.ToArray();
              }
          }
  
          var installCertificate = KeyChain.CreateInstallIntent();
          installCertificate.PutExtra(KeyChain.ExtraCertificate, certificate);
          StartActivity(installCertificate);
  </code></pre>
  
  <p>The above code adds the certificate to the android trusted store in the "user" section and allows me to navigate to the site through the internet app on the androidEmulator without problem, so it seems the problem only appears when trying to make ServiceStack calls in my apps code.</p>
  
  <p>Am I missing something in my code, like extra set up that service stack needs or something like that? I have been struggling with this problem for a few days now and at a real road block!
  I am trying to keep the webservice calls as servicestack as I want it to be PCL rather than android specific code.</p>
  
  <p>Thanks.</p>