pub struct TlsConfig {
pub cert_path: Option<String>,
pub key_path: Option<String>,
pub ca_path: Option<String>,
pub verify_peer: bool,
pub server_name: Option<String>,
}Expand description
TLS configuration for LANCE connections
Fields§
§cert_path: Option<String>Path to certificate file (PEM format)
key_path: Option<String>Path to private key file (PEM format)
ca_path: Option<String>Path to CA certificate for verification
verify_peer: boolWhether to verify peer certificates
server_name: Option<String>Server name for SNI (client only)
Implementations§
Source§impl TlsConfig
impl TlsConfig
Sourcepub fn server(cert_path: impl AsRef<Path>, key_path: impl AsRef<Path>) -> Self
pub fn server(cert_path: impl AsRef<Path>, key_path: impl AsRef<Path>) -> Self
Create a new TLS config for server mode
Sourcepub fn client(ca_path: Option<impl AsRef<Path>>) -> Self
pub fn client(ca_path: Option<impl AsRef<Path>>) -> Self
Create a new TLS config for client mode
Sourcepub fn mtls(
cert_path: impl AsRef<Path>,
key_path: impl AsRef<Path>,
ca_path: impl AsRef<Path>,
) -> Self
pub fn mtls( cert_path: impl AsRef<Path>, key_path: impl AsRef<Path>, ca_path: impl AsRef<Path>, ) -> Self
Create a new TLS config for mutual TLS (mTLS)
Sourcepub fn with_server_name(self, name: impl Into<String>) -> Self
pub fn with_server_name(self, name: impl Into<String>) -> Self
Set the server name for SNI
Sourcepub fn with_insecure(self) -> Self
pub fn with_insecure(self) -> Self
Disable peer certificate verification (NOT RECOMMENDED for production)
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request