title: How to implement "SecurityProtocolType.Ssl, Ssl1, Ssl2, Ssl3; " through web.config not in global.asax.cs
body: <p>My question is simple, I have read these two main pages :</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/2859790/the-request-was-aborted-could-not-create-ssl-tls-secure-channel">The request was aborted: Could not create SSL/TLS secure channel</a></li>
  <li><a href="https://msdn.microsoft.com/en-us/library/zsk61s76(v=vs.110).aspx" rel="nofollow noreferrer">MSDN -  Element</a></li>
  </ul>
  
  <p>But from the first link, it's showing configuration for SecurityProtocol set in global.asax.cs for solving </p>
  
  <blockquote>
    <p>"System.Net.WebException: The request was aborted: Could not create
    SSL/TLS secure channel."</p>
  </blockquote>
  
  <p>Here, I want this config is set in <strong>web.config / app.config</strong>, just for making it a little specific for own project not for all asp.net projects... Then I think the second link {msdn.microsoft.com.....} is the way, but the SSL/TLS error is still there... So my question <strong>how to implement following through web.config</strong>?</p>
  
  <pre><code>ServicePointManager.Expect100Continue = true;
  ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
          | SecurityProtocolType.Tls11
          | SecurityProtocolType.Tls12
          | SecurityProtocolType.Ssl3;
  </code></pre>
  
  <p>I have read this page too <a href="https://stackoverflow.com/questions/32693391/force-by-config-to-use-tls-1-0-in-a-wcf-client-c-sharp">Force by config to use tls 1.0 in a wcf client c#</a>, but there are no answers.</p>
  
  <p>and then... I just found these pages :</p>
  
  <ul>
  <li><a href="https://msdn.microsoft.com/en-us/library/ms731328(v=vs.110).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/ms731328(v=vs.110).aspx</a></li>
  <li><a href="https://msdn.microsoft.com/en-us/library/ms731377(v=vs.100).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/ms731377(v=vs.100).aspx</a></li>
  </ul>
  
  <p>then I implement my custom binding like this :</p>
  
  <pre><code>&lt;customBinding &gt;
        &lt;binding name="SureTaxSoap"&gt;                  
             &lt;sslStreamSecurity requireClientCertificate="true"   sslProtocols="Ssl3|Tls|Tls11|Tls12" &gt;                    
                  &lt;/sslStreamSecurity&gt;
              &lt;/binding&gt;
  &lt;/customBinding&gt;
  </code></pre>
  
  <p>but sslProtocols="Ssl3|Tls|Tls11|Tls12" is unidentified</p>