pub struct Config { /* private fields */ }
Expand description
Stores configuration shared between multiple connections.
Implementations
Creates a config object with the given version.
Examples:
let config = quiche::Config::new(quiche::PROTOCOL_VERSION)?;
Configures the given certificate chain.
The content of file
is parsed as a PEM-encoded leaf certificate,
followed by optional intermediate certificates.
Examples:
config.load_cert_chain_from_pem_file("/path/to/cert.pem")?;
Configures the given private key.
The content of file
is parsed as a PEM-encoded private key.
Examples:
config.load_priv_key_from_pem_file("/path/to/key.pem")?;
Specifies a file where trusted CA certificates are stored for the purposes of certificate verification.
The content of file
is parsed as a PEM-encoded certificate chain.
Examples:
config.load_verify_locations_from_file("/path/to/cert.pem")?;
Specifies a directory where trusted CA certificates are stored for the purposes of certificate verification.
The content of dir
a set of PEM-encoded certificate chains.
Examples:
config.load_verify_locations_from_directory("/path/to/certs")?;
Configures whether to verify the peer’s certificate.
The default value is true
for client connections, and false
for
server ones.
Configures whether to send GREASE values.
The default value is true
.
Enables logging of secrets.
When logging is enabled, the set_keylog()
method must be called on
the connection for its cryptographic secrets to be logged in the
keylog format to the specified writer.
Configures the session ticket key material.
On the server this key will be used to encrypt and decrypt session tickets, used to perform session resumption without server-side state.
By default a key is generated internally, and rotated regularly, so applications don’t need to call this unless they need to use a specific key (e.g. in order to support resumption across multiple servers), in which case the application is also responsible for rotating the key to provide forward secrecy.
Enables sending or receiving early data.
Configures the list of supported application protocols.
The list of protocols protos
must be in wire-format (i.e. a series
of non-empty, 8-bit length-prefixed strings).
On the client this configures the list of protocols to send to the server as part of the ALPN extension.
On the server this configures the list of supported protocols to match against the client-supplied list.
Applications must set a value, but no default is provided.
Examples:
config.set_application_protos(b"\x08http/1.1\x08http/0.9")?;
Sets the max_idle_timeout
transport parameter, in milliseconds.
The default value is infinite, that is, no timeout is used.
Sets the max_udp_payload_size transport
parameter.
The default value is 65527
.
Sets the maximum outgoing UDP payload size.
The default and minimum value is 1200
.
Sets the initial_max_data
transport parameter.
When set to a non-zero value quiche will only allow at most v
bytes
of incoming stream data to be buffered for the whole connection (that
is, data that is not yet read by the application) and will allow more
data to be received as the buffer is consumed by the application.
The default value is 0
.
Sets the initial_max_stream_data_bidi_local
transport parameter.
When set to a non-zero value quiche will only allow at most v
bytes
of incoming stream data to be buffered for each locally-initiated
bidirectional stream (that is, data that is not yet read by the
application) and will allow more data to be received as the buffer is
consumed by the application.
The default value is 0
.
Sets the initial_max_stream_data_bidi_remote
transport parameter.
When set to a non-zero value quiche will only allow at most v
bytes
of incoming stream data to be buffered for each remotely-initiated
bidirectional stream (that is, data that is not yet read by the
application) and will allow more data to be received as the buffer is
consumed by the application.
The default value is 0
.
Sets the initial_max_stream_data_uni
transport parameter.
When set to a non-zero value quiche will only allow at most v
bytes
of incoming stream data to be buffered for each unidirectional stream
(that is, data that is not yet read by the application) and will allow
more data to be received as the buffer is consumed by the application.
The default value is 0
.
Sets the initial_max_streams_bidi
transport parameter.
When set to a non-zero value quiche will only allow v
number of
concurrent remotely-initiated bidirectional streams to be open at any
given time and will increase the limit automatically as streams are
completed.
A bidirectional stream is considered completed when all incoming data
has been read by the application (up to the fin
offset) or the
stream’s read direction has been shutdown, and all outgoing data has
been acked by the peer (up to the fin
offset) or the stream’s write
direction has been shutdown.
The default value is 0
.
Sets the initial_max_streams_uni
transport parameter.
When set to a non-zero value quiche will only allow v
number of
concurrent remotely-initiated unidirectional streams to be open at any
given time and will increase the limit automatically as streams are
completed.
A unidirectional stream is considered completed when all incoming data
has been read by the application (up to the fin
offset) or the
stream’s read direction has been shutdown.
The default value is 0
.
Sets the ack_delay_exponent
transport parameter.
The default value is 3
.
Sets the max_ack_delay
transport parameter.
The default value is 25
.
Sets the disable_active_migration
transport parameter.
The default value is false
.
Sets the congestion control algorithm used by string.
The default value is cubic
. On error Error::CongestionControl
will be returned.
Examples:
config.set_cc_algorithm_name("reno");
Sets the congestion control algorithm used.
The default value is CongestionControlAlgorithm::CUBIC
.
Configures whether to enable HyStart++.
The default value is true
.
Configures whether to enable receiving DATAGRAM frames.
When enabled, the max_datagram_frame_size
transport parameter is set
to 65536 as recommended by draft-ietf-quic-datagram-01.
The default is false
.
Sets the maximum size of the connection window.
The default value is MAX_CONNECTION_WINDOW (24MBytes).
Sets the maximum size of the stream window.
The default value is MAX_STREAM_WINDOW (16MBytes).