pub struct TlsConfig { /* private fields */ }Expand description
TLS configuration for TAK client connections
Implementations§
Source§impl TlsConfig
impl TlsConfig
Sourcepub fn new_with_p12(p12_path: impl AsRef<Path>, password: &str) -> Result<Self>
pub fn new_with_p12(p12_path: impl AsRef<Path>, password: &str) -> Result<Self>
Create a new TLS configuration from a PKCS#12 file (pure Rust implementation)
Note: This implementation may not support legacy PKCS#12 files from TAK servers.
For full support, enable the openssl-p12 feature flag.
Sourcepub fn new_with_client_cert(
ca_cert_path: impl AsRef<Path>,
client_cert_path: impl AsRef<Path>,
client_key_path: impl AsRef<Path>,
) -> Result<Self>
pub fn new_with_client_cert( ca_cert_path: impl AsRef<Path>, client_cert_path: impl AsRef<Path>, client_key_path: impl AsRef<Path>, ) -> Result<Self>
Create a new TLS configuration with client certificate authentication (mTLS)
§Arguments
ca_cert_path- Path to the CA certificate file (PEM format)client_cert_path- Path to the client certificate file (PEM format)client_key_path- Path to the client private key file (PEM format)
§Example
let tls_config = TlsConfig::new_with_client_cert(
"ca.pem",
"client.pem",
"client-key.pem"
)?;Sourcepub fn new_with_system_roots() -> Result<Self>
pub fn new_with_system_roots() -> Result<Self>
Create a TLS configuration that trusts the system root certificates without client authentication
Note: Most TAK servers require client certificate authentication,
so you’ll typically want to use new_with_client_cert instead.
Sourcepub fn new_with_ca_cert(ca_cert_path: impl AsRef<Path>) -> Result<Self>
pub fn new_with_ca_cert(ca_cert_path: impl AsRef<Path>) -> Result<Self>
Create a TLS configuration with a custom CA certificate without client authentication
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 !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