Skip to main content

Module tls

Module tls 

Source
Expand description

TLS/mTLS support for AstraeaDB server.

Provides mutual TLS authentication where both server and client present certificates. Supports optional client certificate verification for standard TLS or enforced mTLS.

Structs§

TlsConfig
TLS configuration for the AstraeaDB server.

Enums§

TlsError
Errors that can occur during TLS configuration and operations.

Functions§

cn_to_role
Map a client certificate CN to a role name. This is a simple mapping that can be customized.
extract_client_cn
Extract the Common Name (CN) from the first certificate in a chain. Returns None if the certificate chain is empty or CN cannot be extracted.
extract_sans
Extract the Subject Alternative Names (SANs) from a certificate. Returns DNS names and IP addresses found in the SAN extension.
load_certs
Load PEM-encoded certificates from a file.
load_private_key
Load a PEM-encoded private key from a file. Supports RSA, EC, and PKCS#8 private keys.