none
Can someone help me solve the error: The remote ssl client failed to provide a required certificate even when defined and set in the behavior RRS feed

  • Question

  • Before I submit the error conditions, I'd like to define my intentions.

    I have a service that requires callbacks that  like to authenticate with a certificate with some level of security.  I am using net.tcpbinding through the internet. (i was told that should be ok)  as i was warned of how much of a pain dualhttpbinding is when behind nat.

    I followed this link for a outline for what needs to be done: http://wcfsecurity.codeplex.com/wikipage?title=How%20To%20-%20Use%20netTcpBinding%20with%20Windows%20Authentication%20and%20Transport%20Security%20in%20WCF%20from%20Windows%20Forms&referringTitle=How%20Tos
    and
    http://wcfsecurityguide.codeplex.com/wikipage?title=How%20To%20-%20Create%20and%20Install%20Temporary%20Client%20Certificates%20in%20WCF%20During%20Development&referringTitle=Introduction

    to make the certificates

    following the instructions i get my app.config

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
       <behaviors>
        <endpointBehaviors>
         <behavior name="NewBehavior0">
          <clientCredentials>
           <clientCertificate findValue="MyCertAuth" x509FindType="FindBySubjectName" storeLocation="LocalMachine" />
           <serviceCertificate>
            <authentication certificateValidationMode="PeerTrust" revocationMode="NoCheck"/>
           </serviceCertificate>
          </clientCredentials>
         </behavior>
        </endpointBehaviors>
       </behaviors> 
       <bindings>
        <netTcpBinding>
         <binding name="NetTcpBinding_IMyService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
          hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288"
          maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
           maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00" />
          <security mode="TransportWithMessageCredential" />
         </binding>
        </netTcpBinding>
        
       </bindings>
        <client>
         
          <endpoint address="net.tcp://ActualIP:Port/MyService.svc"
            binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IMyService"
            contract="DuplexService.IMyService" name="NetTcpBinding_IMyService" behaviorConfiguration="NewBehavior0">
            <identity>
              <dns value="ServerName" />
             <certificate encodedValue="..." />
            </identity>
          </endpoint>
        </client>
      </system.serviceModel>
    </configuration>

    And the web.config

    <system.serviceModel>
      <behaviors>
       <serviceBehaviors>
        <behavior name="ServiceCredentialsBehavior" >
         <serviceMetadata httpGetEnabled="true" />
         <serviceDebug includeExceptionDetailInFaults="true" />
         <serviceCredentials>
          <clientCertificate>
           <authentication certificateValidationMode="ChainTrust" revocationMode="NoCheck" />
          </clientCertificate>
          <serviceCertificate findValue="ServerName" storeLocation="LocalMachine"
           storeName="My" x509FindType="FindBySubjectName" />
         </serviceCredentials>
        </behavior>
        
       </serviceBehaviors>
      </behaviors>
      <bindings>
       <netTcpBinding>
        <binding name="NewBinding0" openTimeout="00:10:00" sendTimeout="00:10:00"
         maxBufferSize="1000000" maxConnections="10000" maxReceivedMessageSize="1000000">
         <security>
          <transport clientCredentialType="Certificate" protectionLevel="EncryptAndSign">
           <extendedProtectionPolicy policyEnforcement="Never" />
          </transport>
         
         </security>
        </binding>
       </netTcpBinding>
      </bindings>
      <services>
       <service behaviorConfiguration="ServiceCredentialsBehavior" name="DuplexService.MyService">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration="NewBinding0"
         contract="DuplexService.IMyService" />
       </service>
      </services>
      <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
     </system.serviceModel>

    When i run the test app and i get the connection was aborted exception.
    On the server logs it gives me the error in the title.

    Can someone direct me to where my mistake is?  I've defined the certificate and set it in the binding configuration so i am confused as to why it is giving me this error.

    • Edited by Ddime1 Wednesday, March 9, 2011 9:22 PM more descriptive title
    Wednesday, March 9, 2011 4:40 PM

Answers