#[non_exhaustive]pub enum TlsNegotiationMode {
PostPreLogin,
Strict,
}Expand description
TDS TLS negotiation mode.
This determines when TLS handshake occurs relative to TDS protocol messages.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PostPreLogin
TDS 7.x style: TLS handshake occurs after PreLogin exchange.
TCP Connect → PreLogin (cleartext) → TLS Handshake → Login7 (encrypted)This is the default for SQL Server 2019 and earlier, and for
SQL Server 2022+ when Encrypt=true (not strict).
Strict
TDS 8.0 strict mode: TLS handshake occurs immediately after TCP connect.
TCP Connect → TLS Handshake → PreLogin (encrypted) → Login7 (encrypted)This is required for SQL Server 2022+ when Encrypt=strict is set.
All TDS traffic is encrypted, including the PreLogin packet.
Implementations§
Source§impl TlsNegotiationMode
impl TlsNegotiationMode
Sourcepub fn is_tls_first(&self) -> bool
pub fn is_tls_first(&self) -> bool
Check if this mode requires TLS before any TDS traffic.
Sourcepub fn prelogin_encrypted(&self) -> bool
pub fn prelogin_encrypted(&self) -> bool
Check if PreLogin is sent in cleartext.
Sourcepub fn from_encrypt_mode(encrypt_strict: bool) -> Self
pub fn from_encrypt_mode(encrypt_strict: bool) -> Self
Get the mode from encryption settings.
§Arguments
encrypt_strict- WhetherEncrypt=strictis set (TDS 8.0)
Trait Implementations§
Source§impl Clone for TlsNegotiationMode
impl Clone for TlsNegotiationMode
Source§fn clone(&self) -> TlsNegotiationMode
fn clone(&self) -> TlsNegotiationMode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TlsNegotiationMode
impl Debug for TlsNegotiationMode
Source§impl Hash for TlsNegotiationMode
impl Hash for TlsNegotiationMode
Source§impl PartialEq for TlsNegotiationMode
impl PartialEq for TlsNegotiationMode
impl Copy for TlsNegotiationMode
impl Eq for TlsNegotiationMode
impl StructuralPartialEq for TlsNegotiationMode
Auto Trait Implementations§
impl Freeze for TlsNegotiationMode
impl RefUnwindSafe for TlsNegotiationMode
impl Send for TlsNegotiationMode
impl Sync for TlsNegotiationMode
impl Unpin for TlsNegotiationMode
impl UnsafeUnpin for TlsNegotiationMode
impl UnwindSafe for TlsNegotiationMode
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