views:

307

answers:

1

I want to expose an implementation of a contract over a WebHttpBinding with SecurityMode: transport (SSL).

However, when I try to access the site via Firefox, I only get

The connection to localhost was interrupted while the page was loading.

The config file is as follows:

<configuration>
  <system.serviceModel>
    <services>
      <service name="MyService">
        <endpoint address="https://localhost"
                  binding="webHttpBinding"
                  contract="MyService"
                  bindingConfiguration="secureWebHttp">
        </endpoint>
      </service>
    </services>
    <bindings>
      <webHttpBinding>
        <binding name="secureWebHttp">
          <security mode="Transport"/>
        </binding>
      </webHttpBinding>
    </bindings>
  </system.serviceModel>
</configuration>
+1  A: 

If host within IIS, you need to configure the hosting website security to use an ssl certificate on port 443 in this case.

You also need to configure the service behavior to set the certificate name and store. Particularly when hosting the wcf service as windows services, the certificate needs to be set for the port that you want to use. for example httpcfg.exe or netsh in vista.

Check out MSDN Configuring HTTP and HTTPS

codemeit