pub struct SimulatedExtensionContext { /* private fields */ }
Expand description
Simulated TLS extension context for certificate type negotiation
Implementations§
Source§impl SimulatedExtensionContext
impl SimulatedExtensionContext
Sourcepub fn new(preferences: CertificateTypePreferences) -> Self
pub fn new(preferences: CertificateTypePreferences) -> Self
Create a new simulated extension context
Sourcepub fn simulate_send_preferences(
&self,
conn_id: &str,
) -> (Option<Vec<u8>>, Option<Vec<u8>>)
pub fn simulate_send_preferences( &self, conn_id: &str, ) -> (Option<Vec<u8>>, Option<Vec<u8>>)
Simulate sending certificate type preferences In reality, this would be sent in ClientHello/ServerHello extensions
Sourcepub fn simulate_receive_preferences(
&self,
conn_id: &str,
client_types_data: Option<&[u8]>,
server_types_data: Option<&[u8]>,
) -> Result<(), TlsExtensionError>
pub fn simulate_receive_preferences( &self, conn_id: &str, client_types_data: Option<&[u8]>, server_types_data: Option<&[u8]>, ) -> Result<(), TlsExtensionError>
Simulate receiving certificate type preferences from peer
Sourcepub fn complete_negotiation(
&self,
conn_id: &str,
) -> Result<NegotiationResult, TlsExtensionError>
pub fn complete_negotiation( &self, conn_id: &str, ) -> Result<NegotiationResult, TlsExtensionError>
Complete the negotiation and get the result
Sourcepub fn cleanup_connection(&self, conn_id: &str)
pub fn cleanup_connection(&self, conn_id: &str)
Clean up negotiation state for a connection
Trait Implementations§
Source§impl Debug for SimulatedExtensionContext
impl Debug for SimulatedExtensionContext
Source§impl TlsExtensionHooks for SimulatedExtensionContext
impl TlsExtensionHooks for SimulatedExtensionContext
Source§fn on_handshake_complete(&self, conn_id: &str, _is_client: bool)
fn on_handshake_complete(&self, conn_id: &str, _is_client: bool)
Called when the handshake is complete
Source§fn get_client_hello_extensions(&self, conn_id: &str) -> Vec<(u16, Vec<u8>)>
fn get_client_hello_extensions(&self, conn_id: &str) -> Vec<(u16, Vec<u8>)>
Called to get extension data for ClientHello
Source§fn process_server_hello_extensions(
&self,
conn_id: &str,
extensions: &[(u16, Vec<u8>)],
) -> Result<(), TlsExtensionError>
fn process_server_hello_extensions( &self, conn_id: &str, extensions: &[(u16, Vec<u8>)], ) -> Result<(), TlsExtensionError>
Called to process ServerHello extensions
Source§fn get_negotiation_result(&self, conn_id: &str) -> Option<NegotiationResult>
fn get_negotiation_result(&self, conn_id: &str) -> Option<NegotiationResult>
Get the negotiation result for a connection
Auto Trait Implementations§
impl Freeze for SimulatedExtensionContext
impl RefUnwindSafe for SimulatedExtensionContext
impl Send for SimulatedExtensionContext
impl Sync for SimulatedExtensionContext
impl Unpin for SimulatedExtensionContext
impl UnwindSafe for SimulatedExtensionContext
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