Changing the WCF service to require SSL


I have a WCF service which was running fine on a http binding. I've tried to update this to use SSL but i am getting the following error:

"Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [https]."

This only occurs when i set the site to "Require SSL" in IIS 7.5 if I uncheck it it works fine.

Here's my config

    <behavior name="ServiceBehavior" >
      <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false" />
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
    <binding name="wsHttpEndpointBinding">
  <service behaviorConfiguration="ServiceBehavior" name="WcfService1.Service1">
        <add baseAddress="http://localhost/WcfService1/"/>
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration=""
      name="wsHttpEndpoint" contract="WcfService1.IService1" />
    <endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration=""
      name="MexHttpsBindingEndpoint" contract="IMetadataExchange" />
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

I've tried allsorts and nothing seems to get me there, any help is greatly appreciated!

Modify your binding configuration:

    <binding name="wsHttpEndpointBinding">
      <security mode="Transport" />

And reference that configuration in your endpoint by setting its bindingConfiguration attribute to the name of configuration.

<endpoint address="" binding="wsHttpBinding"
  name="wsHttpEndpoint" contract="WcfService1.IService1" />

You can also delete the host section with base address because it is not used when hosting in IIS.