title: How to make my NET.TCP WCF service to handle secure and unsecure communication
body: <p>I have a WCF service that needs to handle the following :</p>
  
  <ul>
  <li>1 Service</li>
  <li>Regular TCP Endpoint</li>
  <li>Secured customUsernamePassword Endpoint</li>
  <li>Secured Windows Endpoint</li>
  </ul>
  
  <p>The system.serviceModel section looks like this :</p>
  
  <pre><code>    &lt;system.serviceModel&gt;
          &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
  
          &lt;behaviors&gt;
     &lt;serviceBehaviors&gt;
      &lt;behavior name="AppClientService.CustomValidator_Behavior"&gt;
       &lt;dataContractSerializer maxItemsInObjectGraph="2147483647" /&gt;
       &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
       &lt;serviceMetadata httpGetEnabled="true" /&gt;
  
       &lt;serviceCredentials&gt;
        &lt;clientCertificate&gt;
         &lt;authentication certificateValidationMode="PeerOrChainTrust" /&gt;
        &lt;/clientCertificate&gt;
        &lt;serviceCertificate findValue="MyService" storeLocation="LocalMachine"
         storeName="Root" x509FindType="FindBySubjectName" /&gt;
        &lt;userNameAuthentication userNamePasswordValidationMode="Custom"
         customUserNamePasswordValidatorType="App.ServiceImplementation.CustomUsernamePasswordValidator, App.ServiceImplementation" /&gt;
       &lt;/serviceCredentials&gt;
  
       &lt;serviceAuthorization principalPermissionMode="Custom" serviceAuthorizationManagerType="App.ServiceImplementation.CustomServiceAuthorizationManager, App.ServiceImplementation"&gt;
        &lt;authorizationPolicies&gt;
         &lt;add policyType="App.ServiceImplementation.CustomAuthorizationPolicy, App.ServiceImplementation" /&gt;
        &lt;/authorizationPolicies&gt;
       &lt;/serviceAuthorization&gt;
      &lt;/behavior&gt;
     &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
          &lt;services&gt;
              &lt;service behaviorConfiguration="AppClientService.CustomValidator_Behavior" name="App.ServiceImplementation.AppClientService"&gt;
          &lt;endpoint binding="netTcpBinding" bindingConfiguration="netTcpRegular" address="Regular" bindingNamespace="http://App.ServiceContracts/2007/11" contract="App.ServiceContracts.IAppClientService" /&gt;
                  &lt;endpoint binding="netTcpBinding" bindingConfiguration="netTcpUserNameMessageSecurity" address="UserName" bindingNamespace="http://App.ServiceContracts/2007/11" contract="App.ServiceContracts.IAppClientService" /&gt;
                  &lt;endpoint binding="netTcpBinding" bindingConfiguration="netTcpWindowMessageSecurity" address="Windows" bindingNamespace="http://App.ServiceContracts/2007/11" contract="App.ServiceContracts.IAppClientService" /&gt;
          &lt;endpoint address="httpMex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
                  &lt;endpoint address="tcpMex" binding="mexTcpBinding" contract="IMetadataExchange" /&gt;
              &lt;/service&gt;
          &lt;/services&gt;
          &lt;bindings&gt;
              &lt;!-- NET.TCP --&gt;
              &lt;netTcpBinding&gt;
                  &lt;binding name="netTcpUserNameMessageSecurity" portSharingEnabled="True" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="01:00:00" sendTimeout="01:00:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647"&gt;
                      &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
                      &lt;reliableSession ordered="true" inactivityTimeout="infinite" enabled="false" /&gt;
                      &lt;security mode="TransportWithMessageCredential"&gt;
                          &lt;transport clientCredentialType="Windows" /&gt;
                          &lt;message clientCredentialType="UserName" /&gt;
                      &lt;/security&gt;
                  &lt;/binding&gt;
                  &lt;binding name="netTcpWindowMessageSecurity" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="infinite" sendTimeout="01:00:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647"&gt;
                      &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
                      &lt;reliableSession ordered="true" inactivityTimeout="infinite" enabled="false" /&gt;
                      &lt;security mode="Message"&gt;
                          &lt;message clientCredentialType="Windows" /&gt;
                      &lt;/security&gt;
                  &lt;/binding&gt;
          &lt;binding name="netTcpRegular" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="infinite" sendTimeout="01:00:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647"&gt;
            &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
            &lt;reliableSession ordered="true" inactivityTimeout="infinite" enabled="false" /&gt;
            &lt;security mode="Transport"&gt;
              &lt;transport clientCredentialType="None" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
              &lt;/netTcpBinding&gt;
          &lt;/bindings&gt;
      &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>This works fine with Windows login and CustomUsername Password login, but Im not sure how to get the regular(unsecure) endpoint working?</p>
  
  <p>Pleas Advice</p>
  
  <p>BestRegards</p>