title: WCF Binding to HTTPS
body: <p>I understand that there are many posts about this, and I've been through all of them that came up on my search and implemented everything that was mentioned.  I have a WCF web service that works on my local system on HTTP, and it worked on the server on HTTP.  But the client requires that this works through HTTPS.  The miriad of posts on this and other sites shows me that this is not as straight forward as it should be, since before this, the ASMX web service "just worked" and didn't need complicated configuration.  </p>
  
  <p>I'm getting the following error with my current configuration:</p>
  
  <blockquote>
    <p>Could not find a base address that matches scheme https for the
    endpoint with binding WSHttpBinding. Registered base address schemes
    are [http].</p>
  </blockquote>
  
  <p>Here is my code as of this moment, after trying for days to configure this to work to no avail:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  
      &lt;!--     --&gt;
      &lt;serviceHostingEnvironment  aspNetCompatibilityEnabled="true" &gt;
          &lt;baseAddressPrefixFilters&gt;
              &lt;add prefix="https://mysite.com"/&gt;
              &lt;add prefix="http://mysite.com"/&gt;
          &lt;/baseAddressPrefixFilters&gt;
      &lt;/serviceHostingEnvironment&gt;
  
      &lt;!-- Set up Custom Behaviors --&gt;    
      &lt;behaviors&gt;
  
          &lt;endpointBehaviors&gt;
          &lt;/endpointBehaviors&gt;
  
          &lt;serviceBehaviors&gt;
              &lt;behavior name="WebPostService.WebPostServiceBehavior"&gt;
                  &lt;serviceMetadata httpsGetEnabled="true" httpsGetUrl="WebPostServices.svc/mex"  /&gt; 
                  &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
              &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
  
      &lt;/behaviors&gt;
  
      &lt;!-- Set up the binding configuration  --&gt;
      &lt;bindings&gt;
  
          &lt;wsHttpBinding&gt;
              &lt;binding    name="SOAPBinding" 
              &gt;
  
                  &lt;security mode="Transport"&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
          &lt;/wsHttpBinding&gt;
  
      &lt;/bindings&gt;
  
      &lt;services&gt;
  
          &lt;service    
                      behaviorConfiguration="WebPostService.WebPostServiceBehavior"
                      name="WebPostService.WebPostService"
          &gt;
  
      &lt;host&gt;
        &lt;baseAddresses&gt;
          &lt;add baseAddress="https://mysite.com/Services/WebPostService.svc"/&gt;
        &lt;/baseAddresses&gt;
      &lt;/host&gt;
              &lt;endpoint   address="" 
                          binding="wsHttpBinding" 
                          bindingConfiguration="SOAPBinding"
                          contract="WebPostService.IWebPostService"
              &gt;
                  &lt;identity&gt;
                      &lt;dns value="mysite.com" /&gt;
                  &lt;/identity&gt;
              &lt;/endpoint&gt;
  
              &lt;endpoint   
                          address="mex" 
                          binding="mexHttpsBinding" 
                          contract="IMetadataExchange" 
              &gt;
              &lt;/endpoint&gt;
  
          &lt;/service&gt;
  
      &lt;/services&gt;
  
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>What am I doing wrong and how can I get this to work over HTTPS?  I'm frustrated that this is not as simple as it should be.  I have been burried in WCF documentation at MSDN for the months working on this project, and have a good grasp of services, end-points and bindings --- enough to frustrate me even more than if I had no knowledge at all. </p>
  
  <p>UPDATE:  Still working on this, I had an odd error when trying to put the full URL for the mex address.  I changed to this:</p>
  
  <pre><code>address="https://prcwebs.com/Services/WebPostService.svc/mex" 
  </code></pre>
  
  <p>and got the error:</p>
  
  <blockquote>
    <p>Security settings for this service require Windows Authentication but
    it is not enabled for the IIS application that hosts this service.</p>
  </blockquote>
  
  <p>I'm not trying to use Windows Authentication, the security setting wasn't changed and is still set to </p>
  
  <blockquote>
    <p>&lt;security mode="Transport" /&gt;</p>
  </blockquote>
  
  <p><a href="https://stackoverflow.com/questions/9817718/could-not-find-a-base-address-that-matches-scheme-https-for-the-endpoint-with-bi">Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http]</a>
   - was not helpful, nothing mentioned that would help
  <a href="https://stackoverflow.com/questions/6846038/could-not-find-a-base-address-that-matches-scheme-http-for-the-endpoint-with-bin">Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding</a>
   - I'm using transport security, this does not apply. tried changing to different security modes, still could not get site to work. </p>