http://codebetter.com/petervanooijen/2010/03/22/a-simple-wcf-service-with-username-password-authentication-the-things-they-don-t-tell-you/

In the subsequent article, he talks about turning off server certificate client side validation. There is no need to do that. As long as the certificate subject name, service dns value on the server config and client config match, WCF won't complain.

    <services>
      <service name="WcfServiceLibrary2.Service1">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="userNameBinding"
          contract="WcfServiceLibrary2.IService1">
          <identity>
            <dns value="testmachine.com" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost/Service1/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
          <serviceCredentials>
            <serviceCertificate findValue="testmachine.com" storeName="TrustedPeople"
              x509FindType="FindBySubjectName" />
          </serviceCredentials>
        </behavior>
      </serviceBehaviors>
    </behaviors>

client config:

    <client>
        <endpoint address="http://localhost/Service1/" binding="wsHttpBinding"
            bindingConfiguration="WSHttpBinding_IService1" contract="ServiceReference1.IService1"
            name="WSHttpBinding_IService1">
            <identity>
                <dns value="testmachine.com" />
            </identity>
        </endpoint>
    </client>

Article #1508
Updated On: 9/17/2013 Index
Was this article helpful? Yes | No