printf(&quot;Failed to set the certificate verification hostname&quot;);
    goto end;
}</code></pre>

<p>All of the above steps must happen before we attempt to perform the handshake otherwise they will have no effect.</p>

<h2 id="Performing-the-handshake">Performing the handshake</h2>

<p>Before we can start sending or receiving application data over a TLS connection the TLS handshake must be performed. We can do this explicitly via the <a href="../man3/SSL_connect.html">SSL_connect(3)</a> function.</p>
