pub struct TlsSetup { /* private fields */ }Expand description
Database connection TLS settings, plus the server-side [tls] config retained only so
the boot path can detect (and refuse) an enabled server-TLS configuration.
Implementations§
Source§impl TlsSetup
impl TlsSetup
Sourcepub const fn new(
tls_config: Option<TlsServerConfig>,
db_tls_config: Option<DatabaseTlsConfig>,
) -> Self
pub const fn new( tls_config: Option<TlsServerConfig>, db_tls_config: Option<DatabaseTlsConfig>, ) -> Self
Create new TLS setup from server configuration.
Sourcepub const fn db_config(&self) -> &Option<DatabaseTlsConfig>
pub const fn db_config(&self) -> &Option<DatabaseTlsConfig>
Get the database TLS configuration.
Sourcepub fn is_tls_enabled(&self) -> bool
pub fn is_tls_enabled(&self) -> bool
Whether server-side [tls] is enabled in the configuration.
Server-side TLS termination is unsupported, so the boot path uses this to refuse to
start rather than serve plaintext under an enabled [tls] config (M-tls-enforce).
Sourcepub fn postgres_ssl_mode(&self) -> &str
pub fn postgres_ssl_mode(&self) -> &str
Get PostgreSQL SSL mode for database connections.
Sourcepub fn redis_ssl_enabled(&self) -> bool
pub fn redis_ssl_enabled(&self) -> bool
Check if Redis TLS is enabled.
Sourcepub fn clickhouse_https_enabled(&self) -> bool
pub fn clickhouse_https_enabled(&self) -> bool
Check if ClickHouse HTTPS is enabled.
Sourcepub fn elasticsearch_https_enabled(&self) -> bool
pub fn elasticsearch_https_enabled(&self) -> bool
Check if Elasticsearch HTTPS is enabled.
Sourcepub fn verify_certificates(&self) -> bool
pub fn verify_certificates(&self) -> bool
Check if certificate verification is enabled for databases.
Sourcepub fn ca_bundle_path(&self) -> Option<&Path>
pub fn ca_bundle_path(&self) -> Option<&Path>
Get the CA bundle path for verifying database certificates.
Sourcepub fn apply_postgres_tls(&self, db_url: &str) -> String
pub fn apply_postgres_tls(&self, db_url: &str) -> String
Get database URL with TLS applied (for PostgreSQL).
Sourcepub fn apply_redis_tls(&self, redis_url: &str) -> String
pub fn apply_redis_tls(&self, redis_url: &str) -> String
Get Redis URL with TLS applied.
Sourcepub fn apply_clickhouse_tls(&self, ch_url: &str) -> String
pub fn apply_clickhouse_tls(&self, ch_url: &str) -> String
Get ClickHouse URL with TLS applied.
Sourcepub fn apply_elasticsearch_tls(&self, es_url: &str) -> String
pub fn apply_elasticsearch_tls(&self, es_url: &str) -> String
Get Elasticsearch URL with TLS applied.
Auto Trait Implementations§
impl Freeze for TlsSetup
impl RefUnwindSafe for TlsSetup
impl Send for TlsSetup
impl Sync for TlsSetup
impl Unpin for TlsSetup
impl UnsafeUnpin for TlsSetup
impl UnwindSafe for TlsSetup
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more