use pyo3::prelude::*;
#[pyclass(name = "TlsConfig", from_py_object)]
#[derive(Clone)]
pub struct PyTlsConfig {
pub(crate) inner: crate::transport::tls::TlsConfig,
}
#[pymethods]
impl PyTlsConfig {
#[staticmethod]
fn server(cert_path: String, key_path: String) -> Self {
Self {
inner: crate::transport::tls::TlsConfig::server(cert_path, key_path),
}
}
#[staticmethod]
fn client(ca_path: String) -> Self {
Self {
inner: crate::transport::tls::TlsConfig::client(ca_path),
}
}
#[staticmethod]
fn client_insecure() -> Self {
Self {
inner: crate::transport::tls::TlsConfig::client_insecure(),
}
}
}