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:Set handshake_properties.collect_extension to
ngtcp2_crypto_picotls_collect_extension()
.Set handshake_properties.collected_extensions to
ngtcp2_crypto_picotls_collected_extensions()
.
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()
andngtcp2_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, andngtcp2_crypto_conn_ref
object must havengtcp2_crypto_conn_ref.get_conn
field assigned to getngtcp2_conn
.It returns 0 if it succeeds, or -1.