pub unsafe extern "C" fn s2n_config_set_cert_chain_and_key_defaults(
    config: *mut s2n_config,
    cert_key_pairs: *mut *mut s2n_cert_chain_and_key,
    num_cert_key_pairs: u32
) -> i32
Expand description

Explicitly sets certificate chain and private key pairs to be used as defaults for each auth method (key type). A “default” certificate is used when there is not an SNI match with any other configured certificate.

Only one certificate can be set as the default per auth method (one RSA default, one ECDSA default, etc.). All previous default certificates will be cleared and re-set when this API is called.

This API is called for a specific s2n_config object. s2n-tls will attempt to automatically choose default certificates for each auth method (key type) based on the order that s2n_cert_chain_and_key are added to the s2n_config using one of the APIs listed above. s2n_config_set_cert_chain_and_key_defaults can be called at any time; s2n-tls will clear defaults and no longer attempt to automatically choose any default certificates.

@param config The configuration object being updated @param cert_key_pairs An array of certificate chain and private key handles @param num_cert_key_pairs The amount of handles in cert_key_pairs @returns S2N_SUCCESS on success. S2N_FAILURE on failure