fix: A certificate rejection does not crash the connection

Fixes moxxy/moxxyv2#137.
This commit is contained in:
PapaTutuWawa committed 2022-11-12 20:57:39 +01:00
1 parent 848d83dc1f
commit 3172450b70
6 files changed
+100 -5

No files matched your search

+9
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();
}
}