title: WCF authentication  over https
body: <p>I have a WCF service that is using https to communicate and json for the response format. I don't want my methods to be available to anyone so i change the authentication in IIS from anonymous &amp; basic to just basic. </p>
  
  <p>So far, the browser is asking for user and pass but i get the following error : </p>
  
  <blockquote>
    <p>Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https].</p>
  </blockquote>
  
  <p>What do i have to change to my endpoint to work with authentication ?</p>
  
  <p>My web.config looks like :</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.web&gt;
      &lt;compilation debug="false" targetFramework="4.0" /&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;webHttpBinding&gt;
          &lt;binding name="restBinding"&gt;
            &lt;security mode="TransportCredentialOnly"&gt;
              &lt;transport clientCredentialType="Basic" proxyCredentialType="Basic" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/webHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service name="ContactLibrarySecure.ContactLibraryService"&gt;
          &lt;endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration=""
            name="mex" contract="IMetadataExchange" /&gt;
          &lt;endpoint address="rest" behaviorConfiguration="restBehavior"
            binding="webHttpBinding" bindingConfiguration="restBinding"
            name="rest" contract="ContactLibrarySecure.IContact" /&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="https://192.168.1.31/ContactLibrary2.0HTTPS" /&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;endpointBehaviors&gt;
          &lt;behavior name="restBehavior"&gt;
            &lt;webHttp /&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name=""&gt;
            &lt;serviceMetadata httpsGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
    &lt;/system.serviceModel&gt;
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
    &lt;/system.webServer&gt;
  
  &lt;/configuration&gt;
  </code></pre>