want to connect to. Without this information we may get a handshake failure, or we may get connected to the &quot;default&quot; server which may not be the one we were expecting.</p>

<p>To set the SNI hostname data we call the <a href="../man3/SSL_set_tlsext_host_name.html">SSL_set_tlsext_host_name(3)</a> function like this:</p>

<pre><code>/*
 * Tell the server during the handshake which hostname we are attempting
 * to connect to in case the server supports multiple hosts.
 */
if (!SSL_set_tlsext_host_na