title: WCF metadata shows incorrect service URI on HTTPS
body: <p>Using .NET 4.7.1 and minimal WCF configuration, the WSDL, when accessed from HTTPS, shows a HTTP address, and shows the incorrect host unless port 80 is enabled in the configuration.</p>
  
  <p>This service should only be available on HTTPS, which will be enforced by a firewall rule further along.</p>
  
  <p>My configuration looks like this</p>
  
  <pre><code>&lt;system.serviceModel&gt;     
    &lt;behaviors&gt;     
      &lt;serviceBehaviors&gt;  
        &lt;behavior&gt;  
          &lt;serviceMetadata httpsGetEnabled="True"/&gt;   
          &lt;useRequestHeadersForMetadataAddress/&gt;          
        &lt;/behavior&gt;  
      &lt;/serviceBehaviors&gt;  
    &lt;/behaviors&gt;  
  &lt;/system.serviceModel&gt; 
  </code></pre>
  
  <p>And the result looks like this in a browser (demonstrating incorrect scheme and incorrect host. Sorry that I must block out most of this, but you should be able to get what I'm saying...)</p>
  
  <p><a href="https://i.stack.imgur.com/18k5V.png" rel="nofollow noreferrer">resulting wsdl</a></p>
  
  <p>I understand that "useRequestHeadersForMetadataAddress" tells WCF that I indeed want the WSDL right next to the service. I assumed it also should be able to handle the same intentions for scheme. </p>
  
  <p>Any thoughts?</p>