disable TlsClientConnection close to prevent rehandshake failure on user certificate change in runtime

This commit is contained in:
yggverse 2024-11-30 16:45:02 +02:00
parent fbfd7a2c67
commit 79f219ba76

View file

@ -53,15 +53,16 @@ impl Connection {
/// Close owned [SocketConnection](https://docs.gtk.org/gio/class.SocketConnection.html) /// Close owned [SocketConnection](https://docs.gtk.org/gio/class.SocketConnection.html)
/// and [TlsClientConnection](https://docs.gtk.org/gio/iface.TlsClientConnection.html) if active /// and [TlsClientConnection](https://docs.gtk.org/gio/iface.TlsClientConnection.html) if active
pub fn close(&self) -> Result<(), Error> { pub fn close(&self) -> Result<(), Error> {
/* Do not close `TlsClientConnection` as wanted for re-handshake
on user certificate change in runtime! @TODO
if let Some(ref tls_client_connection) = self.tls_client_connection { if let Some(ref tls_client_connection) = self.tls_client_connection {
if !tls_client_connection.is_closed() { if !tls_client_connection.is_closed() {
if let Err(e) = tls_client_connection.close(self.cancellable.as_ref()) { if let Err(e) = tls_client_connection.close(self.cancellable.as_ref()) {
return Err(Error::TlsClientConnection(e)); return Err(Error::TlsClientConnection(e));
} }
} }
} } */
if !self.socket_connection.is_closed() { if !self.socket_connection.is_closed() {
// @TODO duplicated condition?
if let Err(e) = self.socket_connection.close(self.cancellable.as_ref()) { if let Err(e) = self.socket_connection.close(self.cancellable.as_ref()) {
return Err(Error::SocketConnection(e)); return Err(Error::SocketConnection(e));
} }