Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF - Disabling security in nettcpbinding (c#)

I'm trying to make a self hosted WCF app that uses nettcpbinding but works in an environment without a domain.

It's just two regular windows pc's, one is the server and the other one will be the client. The problem with this is that when I try to get the client to connect it's rejected because of the security settings.

Can you please point me in the right direction as to how I can get this scenario to work?

Should I (if possible) disable security? Is there another (hopefully simple) way to accomplish this?

Regards,

Daniel

like image 265
user302259 Avatar asked Apr 30 '10 22:04

user302259


People also ask

What is NetTcpBinding in WCF?

Remarks. This binding generates a run-time communication stack by default, which uses transport security, TCP for message delivery, and a binary message encoding. This binding is an appropriate Windows Communication Foundation (WCF) system-provided choice for communicating over an Intranet.

What is WCF security?

Windows Communication Foundation (WCF) is a SOAP message-based distributed programming platform, and securing messages between clients and services is essential to protecting data.

Why WCF is more secure?

WCF service provides us high level security framework which provide enterprise level security. It uses WS-I standard to provide secure service. But Web API uses web standard security such as basic authentication, token authentication and for more complex such as OAuth; Web API provides more flexibility.

Is NET TCP secure?

This configuration element provides the security specifications for netTcpBinding . This is a secure, reliable, optimized binding suitable for cross-machine communication.


1 Answers

If you'd like to disable security for testing purposes, in the App.config of the WCF project, change the security element to <security mode="None" />, e.g.:

<bindings>
  <netTcpBinding>
    <binding name="netTcpBindingConfig" transferMode="Buffered" maxReceivedMessageSize="5242880">
      <readerQuotas maxArrayLength="5242880" />
      <security mode="None" />
    </binding>
  </netTcpBinding>
</bindings>

If you have a client, update the service reference to sync the security settings. Keep in mind that you should use some level of security in production environments.

like image 188
Allon Guralnek Avatar answered Sep 17 '22 14:09

Allon Guralnek