pub enum SslMode {
Disable,
Prefer,
Require,
VerifyCa,
VerifyFull,
}Expand description
SSL/TLS connection mode.
These are libpq’s sslmode values and carry libpq’s meanings. In
particular Require encrypts but does not authenticate the server —
use SslMode::VerifyFull if you want the certificate chain and hostname
checked. libpq’s allow is deliberately not supported; see FromStr.
Variants§
Disable
Never use TLS.
Prefer
Try TLS first (without verifying the certificate), fall back to plaintext.
Require
Require TLS, but do not verify the server certificate.
VerifyCa
Require TLS and verify the certificate chain, but not the hostname.
VerifyFull
Require TLS and verify both the certificate chain and the hostname.
Implementations§
Source§impl SslMode
impl SslMode
Sourcepub fn verifies_certificate(&self) -> bool
pub fn verifies_certificate(&self) -> bool
Whether this mode verifies the server certificate chain at all.
Sourcepub fn requires_tls(&self) -> bool
pub fn requires_tls(&self) -> bool
Whether TLS is mandatory — i.e. a plaintext connection is not acceptable.
Trait Implementations§
impl Copy for SslMode
impl Eq for SslMode
impl StructuralPartialEq for SslMode
Auto Trait Implementations§
impl Freeze for SslMode
impl RefUnwindSafe for SslMode
impl Send for SslMode
impl Sync for SslMode
impl Unpin for SslMode
impl UnsafeUnpin for SslMode
impl UnwindSafe for SslMode
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