title: Restrict anything but TLS 1.2 serverside WCF
body: <p>I have a simple question but can't find an answer anywhere.
  I have a WCF-Server-Application. I want it to use ONLY TLS1.2.</p>
  <p>I have no control over the client and am not able to edit the SCHANNEL settings on the machine.</p>
  <p>I did already try the following which seems to work only for outgoing connections (clientside)</p>
  <pre><code>System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 
  </code></pre>
  <p>Is there any way to restrict anything but TLS 1.2 serverside per code?</p>
  <p>EDIT:
  I am using a net.tcp binding and create bindings like that:</p>
  <pre><code>private static Binding CreateNetTcpBinding()
      {
          return new NetTcpBinding
          {
              ReceiveTimeout = TimeSpan.FromMinutes(10),
           
              ReliableSession =
              {
                  Enabled = true,
                  InactivityTimeout = TimeSpan.FromMinutes(1)
              },
              Security =
              {
                  Mode = SecurityMode.Transport,
                  Transport =
                  {
                      ClientCredentialType = TcpClientCredentialType.Windows,
                      ProtectionLevel = ProtectionLevel.EncryptAndSign,
                      SslProtocols = SslProtocols.Tls12
                  },
                  Message =
                  {
                      AlgorithmSuite = SecurityAlgorithmSuite.xxx,
                      ClientCredentialType = MessageCredentialType.Windows
                  }
              }
          };
      }
  </code></pre>
  <p>If someone could tell me where to check the TLS-Version of the current connection (some context) that would also be enough!</p>
  <p>Thank you in advance!</p>