SSL_CTX_set_client_CA_list 3 2001-07-10 0.9.9-dev OpenSSL

NAME

SSL_CTX_set_client_CA_list, SSL_set_client_CA_list, SSL_CTX_add_client_CA, SSL_add_client_CA - set list of CAs sent to the client when requesting a client certificate

LIBRARY

libcrypto, -lcrypto

SYNOPSIS


 #include 





 void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *list);
 void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *list);
 int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *cacert);
 int SSL_add_client_CA(SSL *ssl, X509 *cacert);

DESCRIPTION

_S_S_L___C_T_X___s_e_t___c_l_i_e_n_t___C_A___l_i_s_t_(_) sets the lliisstt of CAs sent to the client when requesting a client certificate for ccttxx.

_S_S_L___s_e_t___c_l_i_e_n_t___C_A___l_i_s_t_(_) sets the lliisstt of CAs sent to the client when requesting a client certificate for the chosen ssssll, overriding the setting valid for ssssll's SSL_CTX object.

_S_S_L___C_T_X___a_d_d___c_l_i_e_n_t___C_A_(_) adds the CA name extracted from ccaacceerrtt to the list of CAs sent to the client when requesting a client certificate for ccttxx.

_S_S_L___a_d_d___c_l_i_e_n_t___C_A_(_) adds the CA name extracted from ccaacceerrtt to the list of CAs sent to the client when requesting a client certificate for the chosen ssssll, overriding the setting valid for ssssll's SSL_CTX object.

NOTES

When a TLS/SSL server requests a client certificate (see _SS_SS_LL____CC_TT_XX____ss_ee_tt____vv_ee_rr_ii_ff_yy____oo_pp_tt_ii_oo_nn_ss_((_))), it sends a list of CAs, for which it will accept certificates, to the client.

This list must explicitly be set using _S_S_L___C_T_X___s_e_t___c_l_i_e_n_t___C_A___l_i_s_t_(_) for ccttxx and _S_S_L___s_e_t___c_l_i_e_n_t___C_A___l_i_s_t_(_) for the specific ssssll. The list specified overrides the previous setting. The CAs listed do not become trusted (lliisstt only contains the names, not the complete certificates); use _S_S_L___C_T_X___l_o_a_d___v_e_r_i_f_y___l_o_c_a_t_i_o_n_s(3) to additionally load them for verification.

If the list of acceptable CAs is compiled in a file, the _S_S_L___l_o_a_d___c_l_i_e_n_t___C_A___f_i_l_e(3) function can be used to help importing the necessary data.

_S_S_L___C_T_X___a_d_d___c_l_i_e_n_t___C_A_(_) and _S_S_L___a_d_d___c_l_i_e_n_t___C_A_(_) can be used to add additional items the list of client CAs. If no list was specified before using _S_S_L___C_T_X___s_e_t___c_l_i_e_n_t___C_A___l_i_s_t_(_) or _S_S_L___s_e_t___c_l_i_e_n_t___C_A___l_i_s_t_(_), a new client CA list for ccttxx or ssssll (as appropriate) is opened.

These functions are only useful for TLS/SSL servers.

RETURN VALUES

_S_S_L___C_T_X___s_e_t___c_l_i_e_n_t___C_A___l_i_s_t_(_) and _S_S_L___s_e_t___c_l_i_e_n_t___C_A___l_i_s_t_(_) do not return diagnostic information.

_S_S_L___C_T_X___a_d_d___c_l_i_e_n_t___C_A_(_) and _S_S_L___a_d_d___c_l_i_e_n_t___C_A_(_) have the following return values:

1 The operation succeeded.
0 A failure while manipulating the STACK_OF(X509_NAME) object occurred or
the X509_NAME could not be extracted from ccaacceerrtt. Check the error stack to find out the reason.

EXAMPLES

Scan all certificates in CCAAffiillee and list them as acceptable CAs:


  SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile));

SEE ALSO

_s_s_l(3), _S_S_L___g_e_t___c_l_i_e_n_t___C_A___l_i_s_t(3), _S_S_L___l_o_a_d___c_l_i_e_n_t___C_A___f_i_l_e(3), _S_S_L___C_T_X___l_o_a_d___v_e_r_i_f_y___l_o_c_a_t_i_o_n_s(3)