
<pre><code>/* Do the handshake with the server */
if (SSL_connect(ssl) &lt; 1) {
    printf(&quot;Failed to connect to the server\n&quot;);
    /*
     * If the failure is due to a verification error we can get more
     * information about it from SSL_get_verify_result().
     */
    if (SSL_get_verify_result(ssl) != X509_V_OK)
        printf(&quot;Verify error: %s\n&quot;,
            X509_verify_cert_error_string(SSL_get_verify_result(ssl)));
    goto end;
}</code></pre>

<p>The <a href="../man3/SSL_con