title: How to enforce the server to use only TLSv1.2?
body: <p>I have a server that processes the soap requests. It uses gSOAP 2.8.14. Currently it allows only TLSv1 connections. I need to enforced it to allow only TLSv1.2 connection.</p>
  <pre><code>if (soap_ssl_server_context(&amp;soap,
       SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION | SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION | SOAP_TLSv1,
       keyfile,      // keyfile: required when server must authenticate to clients
       keyfilepass,  // password to read the key file
       NULL,         // optional cacert file to store trusted certificates
       capath,       // optional capath to directory with trusted certificates
       dhfile,       // DH file name or DH key len bits 
       NULL,         // if randfile!=NULL: use a file with random data
       serverId      // server identification for SSL session cache
       ))
    { 
       printf(&quot;SSL Failed to initialize.\n&quot;);
       soap_print_fault(&amp;soap, stderr); 
       return;
    }
  </code></pre>
  <p>According to <a href="http://www.genivia.com/changelog.html" rel="nofollow noreferrer">gSOAP changelog</a>, flags for TLSv1.1 and TLSv1.2 were added in gSOAP 2.8.24. So, I've updated my gSOAP to the latest available version (2.8.27). As described in gSOAP source in stdsoap2.h, to use only TLSv1.2 I need to use <code>SOAP_TLSv1_2</code> flag:</p>
  <pre><code>#define SOAP_TLSv1              0x0000  /* enable TLS v1.0/1.1/1.2 only (default) */
  #define SOAP_SSLv3_TLSv1        0x0040  /* enable SSL v3 and TLS v1.0/1.1/1.2 */
  #define SOAP_SSLv3              0x0080  /* only SSL v3 */
  #define SOAP_TLSv1_0            0x0100  /* only TLS v1.0 */
  #define SOAP_TLSv1_1            0x0200  /* only TLS v1.1 */
  #define SOAP_TLSv1_2            0x0400  /* only TLS v1.2 */
  </code></pre>
  <p>I've replaced <code>SOAP_TLSv1</code> by <code>SOAP_TLSv1_2</code> in my <code>soap_ssl_server_context</code> function.</p>
  <pre><code>if (soap_ssl_server_context(&amp;soap,
           SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION | SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION | SOAP_TLSv1_2,
           ...))
        { 
           printf(&quot;SSL Failed to initialize.\n&quot;);
           soap_print_fault(&amp;soap, stderr); 
           return;
        }
  </code></pre>
  <p>But during testing I've found that server still accept requests over TLSv1.</p>
  <p>So, my question is how to force the sever to process soap requests only over TLSv1.2?</p>