SSL_CTX_set_cert_verify_callback

Replace the built-in peer certificate verification procedure with an application callback.

Synopsis

Declared in <openssl/ssl.h>

void
SSL_CTX_set_cert_verify_callback(
    SSL_CTX* ctx,
    int(* cb)(X509_STORE_CTX*, void*),
    void* arg);

Parameters

NameDescription
ctxSSL context; SSL objects created from it inherit cb and arg at SSL_new time.
cbVerification callback receiving the X509_STORE_CTX and arg; return 1 to accept, 0 to fail; NULL restores the default.
argApplication pointer passed to cb on each invocation.