title: WCF On HTTPS Generates "The provided URI scheme 'https' is invalid; expected 'http'."
body: <p>I have been googling everywhere I can possibly find (including here on Stackoverflow) to figure out an error I've got trying to deploy a WCF service to IIS 7.5 on Windows 7 x64 that runs only over SSL with basic HTTP authentication.  I've got a site in IIS which has a binding to port 50443 for HTTPS with a self-signed cert.  (I can't use the standard port 443, as we plan on deploying this to IIS on a server which is already running Tomcat which is listening on 80 and 443.)</p>
  
  <p>This is the web.config:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;configuration&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0" /&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;serviceMetadata httpsGetEnabled="true"/&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="SSLBinding"&gt;
            &lt;security mode="TransportCredentialOnly"&gt;
              &lt;transport clientCredentialType="Basic"/&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service name="HelloWorldWcf.HelloWorldWcfService"&gt;
          &lt;endpoint name="HelloWorldWcf.HelloWorldWcfService" 
                    address="https://mylaptop:50443/HelloWorld/Service1.svc" 
                    binding="basicHttpBinding" 
                    bindingConfiguration="SSLBinding" 
                    contract="HelloWorldWcf.IHelloWorldWcfService"/&gt;
          &lt;endpoint address="https://mylaptop:50443/HelloWorld/Service1.svc/mex" 
                    binding="mexHttpsBinding" 
                    contract="IMetadataExchange"/&gt;
        &lt;/service&gt;
      &lt;/services&gt;
    &lt;/system.serviceModel&gt;
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>If I browse to the service endpoint address and enter the basic authentication credentials manually, I get the following exception error message displayed in my browser:</p>
  
  <blockquote>
    <p>The provided URI scheme 'https' is invalid; expected 'http'.<br>
    Parameter name: context.ListenUriBaseAddress</p>
  </blockquote>
  
  <p>This is the same error I got trying to run a WCF client against a similar service, except that it ends with "Parameter name: via" (because the parameter name of the method that shows up in the call stack, "System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(URI via)", is in fact "via").</p>
  
  <p>I've tweaked the server and client config files so many times I've lost track, but the web.config file above is my best guess so far--and it doesn't even work from a browser, much less a WCF client.</p>
  
  <p>What do I need to do to access a WCF service hosted in IIS 7.5 on a nonstandard SSL port with basic HTTP authentication over HTTPS?  Help!  (&amp; Thanks!)</p>