网络TCP绑定安全性

时间:2011-11-23 14:56:12

标签: wcf wcf-security

如果我在客户端编写了此代码,那么我的通信不安全或默认安全性会继续吗?其次,数据是否在加密数据中传输?在服务器端,我们没有为安全做任何事情。

NetTcpBinding objNetTcpBinding = new NetTcpBinding();
objNetTcpBinding.Security.Mode = SecurityMode.None;
objNetTcpBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.None;
objNetTcpBinding.Security.Transport.ProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign;
objNetTcpBinding.Security.Message.ClientCredentialType = MessageCredentialType.None;

1 个答案:

答案 0 :(得分:2)

默认情况下,NetTcp绑定在传输级别受到保护。如果您在客户端上禁用了安全性,则还必须在服务器上禁用它,否则将发生异常。在这种情况下,传输将不受保护。

相关问题