ngtcp2_crypto_picotls_configure_server_session

Synopsis

#include <ngtcp2/ngtcp2_crypto_picotls.h>

int ngtcp2_crypto_picotls_configure_server_session(ngtcp2_crypto_picotls_ctx *cptls)

ngtcp2_crypto_picotls_configure_server_session() configures cptls for server side QUIC connection. It performs the following modifications:

The callbacks set by this function only handle QUIC Transport Parameters TLS extension. If an application needs to handle the other TLS extensions, set its own callbacks and call ngtcp2_crypto_picotls_collect_extension() and ngtcp2_crypto_picotls_collected_extensions() form them.

During the QUIC handshake, the first element of handshake_properties.additional_extensions is assigned to send QUIC Transport Parameter TLS extension. Therefore, an application must allocate at least 2 elements for handshake_properties.additional_extensions.

Call ngtcp2_crypto_picotls_deconfigure_session() to free up the resources.

Application must set a pointer to ngtcp2_crypto_conn_ref to ptls_t object by assigning the pointer using ptls_get_data_ptr, and ngtcp2_crypto_conn_ref object must have ngtcp2_crypto_conn_ref.get_conn field assigned to get ngtcp2_conn.

It returns 0 if it succeeds, or -1.