locked
netTcpBinding and logging at Transport Level RRS feed

  • Question

  • Hi

    First of all I’m new to WCF. I developed a simple client and a service hosted in an application domain. I use netTcpBinding as Binding in the host and client application’s configurations. In want to use the WCF logging mechanism in order to see that the message is encrypted when using netTcpBinding instead of basicHttpBinding. So, in order to log the data I used the XmlWriterTraceListener and the following configurations:

        <diagnostics>

          <messageLogging logEntireMessage="true"

                          maxMessagesToLog="300"

                          logMessagesAtServiceLevel="false"

                          logMalformedMessages="false"

                          logMessagesAtTransportLevel="true" />

        </diagnostics>

    When looking at the log file it seems that the message is transmitted in clear text as when using basicHttpBinding. Why is this actually happening? I expected an encrypted message. Do I forgot something?

    Thanks!  

    George Homorozeanu

    Sunday, June 3, 2007 11:12 AM

Answers

  •  

    <netTcpBinding>
       <binding>
          <security mode="Transport">
                <transport clientCredentialType="None/Windows/Certificate"
                    protectionLevel="EncryptAndSign" />
          </security>
       </binding>
    </netTcpBinding>

     

    Make sure the protectionlevel is set correctly.

    http://msdn2.microsoft.com/en-us/library/ms731316.aspx

    Monday, June 11, 2007 10:41 PM

All replies

  •  

    <netTcpBinding>
       <binding>
          <security mode="Transport">
                <transport clientCredentialType="None/Windows/Certificate"
                    protectionLevel="EncryptAndSign" />
          </security>
       </binding>
    </netTcpBinding>

     

    Make sure the protectionlevel is set correctly.

    http://msdn2.microsoft.com/en-us/library/ms731316.aspx

    Monday, June 11, 2007 10:41 PM
  • EncryptAndSign is the default.

     

    When using transport security, you won't see that in the trace - strictly speaking it would have to show you a stream of bytes which wouldn't be very helpful.

     

    If you want to trace at the transport level see here:

    http://www.leastprivilege.com/TracingSystemNet.aspx

    Tuesday, June 12, 2007 10:59 AM