title: Accessing webservice through HTTPS gives ArgumentException
body: <p>In C#, I am trying to access a web service located on an HTTPS address. My code is defined in a class library, which is referred to in the main application(s) using DLLs — so the standard way of configuring the web services with an <code>App.config</code> file is not possible here.
  My code is essentially equal to the following:</p>
  
  <pre><code>var remoteAddress = new System.ServiceModel.EndpointAddress(
      "https://myUrl.com/Service.svc");
  MyServiceClient myClient = new MyServiceClient(
      new System.ServiceModel.WSHttpBinding(),
      remoteAddress);
  myClient.ClientCredentials.ClientCertificate.SetCertificate(
      StoreLocation.CurrentUser,
      StoreName.My,
      X509FindType.FindByThumbprint,
      "91 47 0b e8 80 bf ee 68 32 93 f0 d4 ee e6 14 8c e5 0c fa 3e"
      );
  myClient.Endpoint.Binding.SendTimeout = new TimeSpan(0, 0, 0, 10);
  var myResult = myClient.MyMethod("foo bar");
  </code></pre>
  
  <p>But even though I use WSHttpBinding I get an ArgumentException with the message:</p>
  
  <blockquote>
    <p>The provided URI scheme 'https' is invalid; expected 'http'.<br>
    Parameter name: via</p>
  </blockquote>
  
  <p>Can anyone spot what the problem is?</p>