fix: wrong behavior introduced in TlsConnection

Edited by Félix Olart

Merge request reports