Struct mongodb::options::TlsOptions[][src]

#[non_exhaustive]
pub struct TlsOptions { pub allow_invalid_certificates: Option<bool>, pub ca_file_path: Option<PathBuf>, pub cert_key_file_path: Option<PathBuf>, }
This is supported on crate feature tokio-runtime and non-crate feature async-std-runtime, or non-crate feature tokio-runtime and crate feature async-std-runtime only.
Expand description

Specifies the TLS configuration that the Client should use.

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
allow_invalid_certificates: Option<bool>

Whether or not the Client should return an error if the server presents an invalid certificate. This setting should not be set to true in production; it should only be used for testing.

The default value is to error when the server presents an invalid certificate.

ca_file_path: Option<PathBuf>

The path to the CA file that the Client should use for TLS. If none is specified, then the driver will use the Mozilla root certificates from the webpki-roots crate.

cert_key_file_path: Option<PathBuf>

The path to the certificate file that the Client should present to the server to verify its identify. If none is specified, then the Client will not attempt to verify its identity to the server.

Implementations

Create a builder for building TlsOptions. On the builder, call .allow_invalid_certificates(...)(optional), .ca_file_path(...)(optional), .cert_key_file_path(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of TlsOptions.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

Should always be Self

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

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.