views:

4

answers:

1

Hi!

I have a WCF Service that runs over TCP with Certificate security like this :

<binding name="netTcpUserNameMessageSecurity" portSharingEnabled="True" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647">
                    <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                    <reliableSession ordered="true" inactivityTimeout="infinite" enabled="false" />
                    <security mode="TransportWithMessageCredential">
                        <transport clientCredentialType="Windows" />
                        <message clientCredentialType="UserName" />
                    </security>
                </binding>

When cheking the log in TraceViewer I can see that the data is in clear xml(no encryption). Is the TraceViewer decrypt data or am I really sending all my data in clear xml even when Im using certificate security?

Pleas note that I am running the service and the client on the same machine and the log I am analyzing is from the service.

Best Regards

+1  A: 

You are using transport level encryption which happens outside WCF so your message logging logs the message in the plain text. If you use message level encryption then WCF will get encrypted message from transport channel and logs it (encrypted) next it will process the message in security channel and logs it (decrypted). This logging can be controlled in message logging configuration - logMessagesAtTransportLevel and logMessagesAtServiceLevel.

Ladislav Mrnka
Yes, LogMessageAtTransportLevel and logMessageAtServiceLevel seemse to be a good place to start. But I have infact tried these and the log is somwat strange så we have tested wireshark and with this tool we can see when the communication is encoded and not.
SnowJim