pub struct TlsState {
pub ca: CertAuthority,
pub connector: TlsConnector,
pub config: TlsConfig,
pub secrets: SecretsConfig,
/* private fields */
}Expand description
Shared TLS interception state.
Holds the CA, per-domain certificate cache, upstream TLS connector,
and configuration. Shared across all TLS proxy tasks via Arc.
Fields§
§ca: CertAuthorityCertificate authority for signing per-domain certs.
connector: TlsConnectorTLS connector for upstream (real server) connections.
config: TlsConfigTLS configuration.
secrets: SecretsConfigSecrets configuration for placeholder substitution.
Implementations§
Source§impl TlsState
impl TlsState
Sourcepub fn new(config: TlsConfig, secrets: SecretsConfig) -> Self
pub fn new(config: TlsConfig, secrets: SecretsConfig) -> Self
Create TLS state from configuration.
CA resolution order:
- User-provided paths (
config.ca.cert_path+config.ca.key_path) - Default persistence path (
~/.microsandbox/tls/ca.{crt,key}) - Auto-generate and persist to default path
Sourcepub fn get_or_generate_cert(&self, domain: &str) -> Arc<DomainCert>
pub fn get_or_generate_cert(&self, domain: &str) -> Arc<DomainCert>
Get or generate a certificate for the given domain.
Sourcepub fn should_bypass(&self, sni: &str) -> bool
pub fn should_bypass(&self, sni: &str) -> bool
Check if a domain should bypass TLS interception.
Sourcepub fn ca_cert_pem(&self) -> Vec<u8> ⓘ
pub fn ca_cert_pem(&self) -> Vec<u8> ⓘ
Get the CA certificate PEM bytes for guest installation.
Auto Trait Implementations§
impl !Freeze for TlsState
impl !RefUnwindSafe for TlsState
impl Send for TlsState
impl Sync for TlsState
impl Unpin for TlsState
impl UnsafeUnpin for TlsState
impl !UnwindSafe for TlsState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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