WCF Hosted in IIS over SSL

Last post 02-15-2007 11:05 AM by hughy. 2 replies.

Sort Posts:

  • WCF Hosted in IIS over SSL

    02-14-2007, 5:47 PM
    • Member
      18 point Member
    • hughy
    • Member since 11-18-2006, 1:03 AM
    • Posts 22

    I've got a Windows Communication Foundation service that I'm hosting in IIS 6 and running over SSL using a certificate that I created using selfssl. I'm able to view the .svc with no errors in IE but when I tried to add a service reference to it in Visual Studio I got the following error:

    Error: Cannot obtain Metadata from https://localhost:777/AuthService.svc

    If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.

    WS-Metadata Exchange Error

    URI: https://localhost:777/AuthService.svc

    Metadata contains a reference that cannot be resolved: 'https://localhost:777/AuthService.svc'.

    Could not establish trust relationship for the SSL/TLS secure channel with authority 'localhost:777'.

    The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

    The remote certificate is invalid according to the validation procedure.

    HTTP GET Error

    URI: https://localhost:777/AuthService.svc

    There was an error downloading 'https://localhost:777/AuthService.svc'.

    The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

    The remote certificate is invalid according to the validation procedure.

     

    I checked the article it referenced in the error message and I can't find anything I've got setup wrong. Thanks in advance for any help. Here's my config file:

    <

    system.serviceModel>

    <

    bindings>

    <

    wsHttpBinding>

    <

    binding name="sslTest">

    <

    security mode="Transport">

    <

    transport clientCredentialType="None"/>

    </

    security>

    </

    binding>

    </

    wsHttpBinding>

    </

    bindings>

    <

    services>

    <

    service name="HEI.Auth.BL.AuthUtil" behaviorConfiguration="myServiceBehavior">

    <

    endpoint

    address=""

    binding="wsHttpBinding"

    bindingConfiguration="sslTest"

    contract="HEI.Auth.BL.Interfaces.IAuthenticate" />

    <

    endpoint contract="IMetadataExchange" binding="mexHttpsBinding" address="mex"/>

    <

    host>

    <

    baseAddresses>

    <

    add baseAddress="https://localhost:777/AuthService"/>

    </

    baseAddresses>

    </

    host>

    </

    service>

    </

    services>

     

    <

    behaviors>

    <

    serviceBehaviors>

    <

    behavior name="myServiceBehavior">

    <

    serviceMetadata httpsGetEnabled="true" httpsGetUrl=""/>

    </

    behavior>

    </

    serviceBehaviors>

    </

    behaviors>

    </

    system.serviceModel>
  • Re: WCF Hosted in IIS over SSL

    02-15-2007, 4:04 AM
    • Contributor
      2,460 point Contributor
    • Steve Marx
    • Member since 05-26-2006, 8:35 PM
    • Microsoft
    • Posts 643
    Sorry if I missed something, but this doesn't appear to be related to ASP.NET AJAX.  You might get better help on a WCF forum.
    Steve Marx | ASP.NET AJAX Evangelist | Microsoft Corporation
  • Re: WCF Hosted in IIS over SSL

    02-15-2007, 11:05 AM
    • Member
      18 point Member
    • hughy
    • Member since 11-18-2006, 1:03 AM
    • Posts 22
    The reason I posted it here is because I did a search for wcf and this was about the only forum that had any posts for wcf. Anyway, it was a problem with my certificate. I created a certificate with selfssl but I didn't name it "localhost" so the certificate didn't match the site address. Once I made a new certificate with cn=localhost I was able to add the service reference in visual studio.
Page 1 of 1 (3 items)