Self-hosted WCF service with SSL and IIS not working RRS feed

  • Question

  • I have a self-hosted WCF service and I have reserved the following url namespaces using netsh:



    And I have bound my SSL cert to using netsh.

    All this works fine - I can access my service API at or

    But when I also run IIS, IIS claims my namespace, but only when using SSL! Result is that returns error 404 (served by IIS), while works fine (served by my service)

    What's going on? If the URL is reserved shouldn't IIS not try to serve it? And why is the SSL case different from the non-SSL case? Strange! Bottom line is that I can get IIS working OR my service but not both under SSL. Without SSL, both co-exist.

    Thanks in advance for any help or any clues as to how to diagnose this.

    John M

    Tuesday, May 19, 2015 11:44 PM

All replies

  • hi John,
       As per this case, check the following details which may guide you to resolve this issue :
    1.First you need to list the service in the <system.serviceModel> node like below :

        <service name="CustomerService.CustomerService"
          <endpoint address=""
                    contract="SampleService.ISampleService" />
          <endpoint address="mex"
                    contract="IMetadataExchange" />

    2. You need to define this behavior in the <behaviors> node of the <system.serviceModel> node like below

        <behavior name="MyServiceBehavior">
          <serviceMetadata httpsGetEnabled="true" httpsGetUrl="" />
          <serviceDebug includeExceptionDetailInFaults="false"/>

    Note that the httpsGetEnabled property of the behavior is set to true. This allows you to retrieve metadata for the service using an HTTPS/GET request

    3.After created your ssl certificate then Goto IIS Manager :
    select the Default Web Site node >> In the right pane click on the “Bindings” link.
    Site Bindings popup>>click “Add” button>>
    Add Site Binding popup>>Type “https” >>ssl certificate “choose your certificate” >>Click ok

    4.Restart your web site and navigate to corresponding URL but you may get a warning message because of your SSL certificate may be untrusted . Just ignore it.

    5.for more information, Click here to refer about How to: Configure an IIS-hosted WCF service with SSL

    Wednesday, May 20, 2015 5:22 AM
  • Hi Eric,

    I think my WCF config is correct because my WCF service works properly using SSL or non-SSL when IIS is not running (this is a self-hosted WCF service). The problem is that once I turn IIS on, IIS takes over my URL, but it only does so for SSL - the non-SSL url continues to be served by my service.


    John M

    Wednesday, May 20, 2015 5:42 AM