pub unsafe extern "C" fn s2n_config_set_protocol_preferences(
    config: *mut s2n_config,
    protocols: *const *const c_char,
    protocol_count: c_int
) -> c_int
Expand description

Sets the application protocol preferences on an s2n_config object. protocols is a list in order of preference, with most preferred protocol first, and of length protocol_count.

When acting as an S2N_CLIENT the protocol list is included in the Client Hello message as the ALPN extension.

As an S2N_SERVER, the list is used to negotiate a mutual application protocol with the client. After the negotiation for the connection has completed, the agreed upon protocol can be retrieved with s2n_get_application_protocol()

@param config The configuration object being updated @param protocols The list of preferred protocols, in order of preference @param protocol_count The size of the protocols list @returns S2N_SUCCESS on success. S2N_FAILURE on failure