use Cancellable::NONE for re-handshake action

This commit is contained in:
yggverse 2024-11-30 18:59:06 +02:00
parent cca3e4daa6
commit efc9b62786

View file

@ -71,14 +71,11 @@ impl Connection {
} }
} }
/// Request force handshake for `Self` /// Force non-cancellable handshake request for `Self`
/// * useful for certificate change in runtime /// * useful for certificate change in runtime
/// * support guest and user sessions /// * support guest and user sessions
pub fn rehandshake(&self) -> Result<(), Error> { pub fn rehandshake(&self) -> Result<(), Error> {
match self match self.tls_client_connection()?.handshake(Cancellable::NONE) {
.tls_client_connection()?
.handshake(self.cancellable.as_ref())
{
Ok(()) => Ok(()), Ok(()) => Ok(()),
Err(e) => Err(Error::Rehandshake(e)), Err(e) => Err(Error::Rehandshake(e)),
} }