fix: A certificate rejection does not crash the connection

Fixes moxxy/moxxyv2#137.
This commit is contained in:
2022-11-12 20:56:44 +01:00
parent 848d83dc1f
commit 3172450b70
6 changed files with 100 additions and 5 deletions

View File

@@ -796,6 +796,15 @@ class XmppConnection {
_updateRoutingState(RoutingState.handleStanzas);
await _onNegotiationsDone();
} else if (_currentNegotiator!.state == NegotiatorState.error) {
_log.severe('Negotiator returned an error');
_updateRoutingState(RoutingState.error);
await _setConnectionState(XmppConnectionState.error);
_connectionCompleter?.complete(const XmppConnectionResult(false));
_connectionCompleter = null;
_closeSocket();
}
}