title: Force ServicePointManager.SecurityProtocol to TLS 1.2 on all connections
body: <p>I have a WCF service which sends an outgoing request. Currently it is using <code>SSL 3.0</code> or <code>TLS 1.0</code>.</p>
  
  <p>The service I am sending the request to now only accepts <code>TLS 1.2</code>.</p>
  
  <p>I can set the <code>SecurityProtocolType</code> just before the request (and for each request), but I would like it to use <code>TLS 1.2</code> for all outgoing requests without having to specify it for each request.</p>
  
  <p>This code sets it correctly for the request:</p>
  
  <pre><code>&lt;OperationContract(), WebGet(UriTemplate:="...")&gt;
  Public Function SomeService()
  
      System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType) 3072; // 3072 is TLS 1.2
  
      // Do request
  
  End Function
  </code></pre>
  
  <p>But I cannot see how to set WCF to use <code>TLS 1.2</code> for all requests. I have tried placing the above statement into <code>Application_Start</code> and <code>Application_BeginRequest</code> in <code>Global.asax</code>, but by the time it comes to doing the request, <code>SecurityProtocol</code> is back to <code>SSL3/TLS1.0</code></p>