#[non_exhaustive]pub struct TlsConfig {
pub root_certs: Vec<Vec<u8>>,
pub client_cert: Option<(Vec<Vec<u8>>, Vec<u8>)>,
}Expand description
TLS configuration for PostgreSQL connections.
Construct one of these and pass it to
crate::WireConn::connect_with_tls_config to override the default trust
store (system root CAs from webpki-roots) or to authenticate with a
client certificate.
All certificate and key bytes must be DER-encoded. PEM input is not
accepted; convert it first (for example with rustls_pemfile::certs).
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.root_certs: Vec<Vec<u8>>Custom root CA certificates (DER). If empty, the system trust store is
used via webpki-roots.
client_cert: Option<(Vec<Vec<u8>>, Vec<u8>)>Optional client certificate chain (DER) and private key (DER) for mutual TLS.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TlsConfig
impl RefUnwindSafe for TlsConfig
impl Send for TlsConfig
impl Sync for TlsConfig
impl Unpin for TlsConfig
impl UnsafeUnpin for TlsConfig
impl UnwindSafe for TlsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more