pub unsafe extern "C" fn s2n_config_add_cert_chain_and_key_to_store(
    config: *mut s2n_config,
    cert_key_pair: *mut s2n_cert_chain_and_key
) -> c_int
Expand description

The preferred method of associating a certificate chain and private key pair with an s2n_config object. This method may be called multiple times to support multiple key types(RSA, ECDSA) and multiple domains. On the server side, the certificate selected will be based on the incoming SNI value and the client’s capabilities(supported ciphers).

In the case of no certificate matching the client’s SNI extension or if no SNI extension was sent by the client, the certificate from the first call to s2n_config_add_cert_chain_and_key_to_store will be selected.

@warning It is not recommended to free or modify the cert_key_pair as any subsequent changes will be reflected in the config.

@param config The configuration object being updated @param cert_key_pair The certificate chain and private key handle @returns S2N_SUCCESS on success. S2N_FAILURE on failure