      &amp;rights);
    X509_STORE_CTX_set_flags(ctx, X509_V_FLAG_ALLOW_PROXY_CERTS);
    ok = X509_verify_cert(ctx);

    if (ok == 1) {
        ok = check_needed_rights(rights, needed_rights);
    }

    X509_STORE_CTX_set_verify_cb(ctx, save_verify_cb);

    return ok;
}</code></pre>

<p>If you use SSL or TLS, you can easily set up a callback to have the certificates checked properly, using the code above:</p>

<pre><code>SSL_CTX_set_cert_verify_callback(s_ctx, my_X509_verify_cert,
                      