doc/designs/ddd/ddd-03-fd-blocking.c
/*
 * The application is initializing and wants an SSL_CTX which it will use for
 * some number of outgoing connections, which it creates in subsequent calls to
 * new_conn. The application may also call this function multiple times to
 * create multiple SSL_CTX.
 */
The application is initializing and wants an SSL_CTX which it will use for
some number of outgoing connections, which it creates in subsequent calls to
new_conn. The application may also call this function multiple times to
create multiple SSL_CTX.
The application is initializing and wants an SSL_CTX which it will use for some number of outgoing connections which it creates in subsequent calls to new_conn . The application may also call this function multiple times to create multiple SSL_CTX .
SSL_CTX *create_ssl_ctx(void)
{
    SSL_CTX *ctx;
    ctx = SSL_CTX_new(TLS_client_method());
    if (ctx == NULL)
        return NULL;
    SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
    if (SSL_CTX_set_default_verify_paths(ctx) == 0) {
        SSL_CTX_free(ctx);
        return NULL;
    }
    return ctx;
}
SSL_CTX * create_ssl_ctx ( void ) { SSL_CTX * ctx ; ctx = SSL_CTX_new ( TLS_client_method ( ) ) ; if ( ctx == NULL ) return NULL ; SSL_CTX_set_verify ( ctx , SSL_VERIFY_PEER , NULL ) ; if ( SSL_CTX_set_default_verify_paths ( ctx ) == 0 ) { SSL_CTX_free ( ctx ) ; return NULL ; } return ctx ; }
The application is initializing and wants an SSL_CTX which it will use for
 some number of outgoing connections, which it creates in subsequent calls to
 new_conn.
The application is initializing and wants an SSL_CTX which it will use for some number of outgoing connections which it creates in subsequent calls to new_conn .
/* Enable trust chain verification. */ /* Load default root CA store. */