pub struct TlsHandler { /* private fields */ }Expand description
TLS handler for OpenVPN connections
Implementations§
Source§impl TlsHandler
impl TlsHandler
Sourcepub fn new(config: Arc<ServerConfig>) -> Result<Self>
pub fn new(config: Arc<ServerConfig>) -> Result<Self>
Create a new TLS handler with server configuration
Sourcepub fn process_incoming(&mut self, data: &[u8]) -> Result<()>
pub fn process_incoming(&mut self, data: &[u8]) -> Result<()>
Process incoming TLS data from control channel
Sourcepub fn process_tls_records(&mut self, records: Vec<Bytes>) -> Result<()>
pub fn process_tls_records(&mut self, records: Vec<Bytes>) -> Result<()>
Process incoming TLS records (already extracted from control channel)
Sourcepub fn get_outgoing(&mut self) -> Result<Option<Bytes>>
pub fn get_outgoing(&mut self) -> Result<Option<Bytes>>
Get data to send on control channel
Sourcepub fn is_handshake_complete(&self) -> bool
pub fn is_handshake_complete(&self) -> bool
Check if handshake is complete
Sourcepub fn is_handshaking(&self) -> bool
pub fn is_handshaking(&self) -> bool
Check if we’re still handshaking
Sourcepub fn wants_write(&self) -> bool
pub fn wants_write(&self) -> bool
Check if there’s data waiting to be written
Sourcepub fn read_plaintext(&mut self, buf: &mut [u8]) -> Result<usize>
pub fn read_plaintext(&mut self, buf: &mut [u8]) -> Result<usize>
Read decrypted application data
Sourcepub fn write_plaintext(&mut self, data: &[u8]) -> Result<usize>
pub fn write_plaintext(&mut self, data: &[u8]) -> Result<usize>
Write plaintext data (will be encrypted)
Sourcepub fn peer_certificates(&self) -> Option<Vec<CertificateDer<'static>>>
pub fn peer_certificates(&self) -> Option<Vec<CertificateDer<'static>>>
Get peer certificate if available
Sourcepub fn cipher_suite(&self) -> Option<&'static str>
pub fn cipher_suite(&self) -> Option<&'static str>
Get negotiated cipher suite name
Auto Trait Implementations§
impl Freeze for TlsHandler
impl !RefUnwindSafe for TlsHandler
impl Send for TlsHandler
impl Sync for TlsHandler
impl Unpin for TlsHandler
impl !UnwindSafe for TlsHandler
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