Struct webrtc_dtls::config::Config[][src]

pub struct Config {
Show fields pub certificates: Vec<Certificate>, pub cipher_suites: Vec<CipherSuiteId>, pub signature_schemes: Vec<SignatureScheme>, pub srtp_protection_profiles: Vec<SrtpProtectionProfile>, pub client_auth: ClientAuthType, pub extended_master_secret: ExtendedMasterSecretType, pub flight_interval: Duration, pub psk: Option<fn(_: &[u8]) -> Result<Vec<u8>, Error>>, pub psk_identity_hint: Option<Vec<u8>>, pub insecure_skip_verify: bool, pub insecure_hashes: bool, pub verify_peer_certificate: Option<fn(rawCerts: &[Vec<u8>], verifiedChains: &[Certificate]) -> Result<(), Error>>, pub roots_cas: RootCertStore, pub client_cert_verifier: Option<Arc<dyn ClientCertVerifier>>, pub server_name: String, pub mtu: usize, pub replay_protection_window: usize,
}
Expand description

Config is used to configure a DTLS client or server. After a Config is passed to a DTLS function it must not be modified.

Fields

certificates: Vec<Certificate>

certificates contains certificate chain to present to the other side of the connection. Server MUST set this if psk is non-nil client SHOULD sets this so CertificateRequests can be handled if psk is non-nil

cipher_suites: Vec<CipherSuiteId>

cipher_suites is a list of supported cipher suites. If cipher_suites is nil, a default list is used

signature_schemes: Vec<SignatureScheme>

signature_schemes contains the signature and hash schemes that the peer requests to verify.

srtp_protection_profiles: Vec<SrtpProtectionProfile>

srtp_protection_profiles are the supported protection profiles Clients will send this via use_srtp and assert that the server properly responds Servers will assert that clients send one of these profiles and will respond as needed

client_auth: ClientAuthType

client_auth determines the server’s policy for TLS Client Authentication. The default is NoClientCert.

extended_master_secret: ExtendedMasterSecretType

extended_master_secret determines if the “Extended Master Secret” extension should be disabled, requested, or required (default requested).

flight_interval: Duration

flight_interval controls how often we send outbound handshake messages defaults to time.Second

psk: Option<fn(_: &[u8]) -> Result<Vec<u8>, Error>>

psk sets the pre-shared key used by this DTLS connection If psk is non-nil only psk cipher_suites will be used

psk_identity_hint: Option<Vec<u8>>insecure_skip_verify: bool

insecure_skip_verify controls whether a client verifies the server’s certificate chain and host name. If insecure_skip_verify is true, TLS accepts any certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks. This should be used only for testing.

insecure_hashes: bool

insecure_hashes allows the use of hashing algorithms that are known to be vulnerable.

verify_peer_certificate: Option<fn(rawCerts: &[Vec<u8>], verifiedChains: &[Certificate]) -> Result<(), Error>>

VerifyPeerCertificate, if not nil, is called after normal certificate verification by either a client or server. It receives the certificate provided by the peer and also a flag that tells if normal verification has succeeded. If it returns a non-nil error, the handshake is aborted and that error results.

If normal verification fails then the handshake will abort before considering this callback. If normal verification is disabled by setting insecure_skip_verify, or (for a server) when client_auth is RequestClientCert or RequireAnyClientCert, then this callback will be considered but the verifiedChains will always be nil.

roots_cas: RootCertStore

roots_cas defines the set of root certificate authorities that one peer uses when verifying the other peer’s certificates. If RootCAs is nil, TLS uses the host’s root CA set. Used by Client to verify server’s certificate

client_cert_verifier: Option<Arc<dyn ClientCertVerifier>>

client_cas defines the set of root certificate authorities that servers use if required to verify a client certificate by the policy in client_auth. Used by Server to verify client’s certificate

server_name: String

server_name is used to verify the hostname on the returned certificates unless insecure_skip_verify is given.

mtu: usize

mtu is the length at which handshake messages will be fragmented to fit within the maximum transmission unit (default is 1200 bytes)

replay_protection_window: usize

replay_protection_window is the size of the replay attack protection window. Duplication of the sequence number is checked in this window size. Packet with sequence number older than this value compared to the latest accepted packet will be discarded. (default is 64)

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into a target type. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Performs the conversion.

Performs the conversion.

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into a target type. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.