x)) {
    printf(&quot;Failed to set the default trusted certificate store\n&quot;);
    goto end;
}</code></pre>

<p>We would also like to restrict the TLS versions that we are willing to accept to TLSv1.2 or above. TLS protocol versions earlier than that are generally to be avoided where possible. We can do that using <a href="../man3/SSL_CTX_set_min_proto_version.html">SSL_CTX_set_min_proto_version(3)</a>:</p>

<pre><code>/*
 * TLSv1.1 or earlier are deprecated by IETF and are generally to be
 * avoided 