From 88d2f5dae4866369be33c34c7d8bbf252ead3414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Tue, 5 Apr 2022 19:39:17 +0200 Subject: [PATCH] features_starttls/Proceed: raise exception on InvalidCABundle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp/features/feature_starttls/stanza.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/slixmpp/features/feature_starttls/stanza.py b/slixmpp/features/feature_starttls/stanza.py index 70979402..f433f1b2 100644 --- a/slixmpp/features/feature_starttls/stanza.py +++ b/slixmpp/features/feature_starttls/stanza.py @@ -3,8 +3,12 @@ # Copyright (C) 2011 Nathanael C. Fritz # This file is part of Slixmpp. # See the file LICENSE for copying permission. -from slixmpp.xmlstream import StanzaBase, ElementBase from typing import Set, ClassVar +from slixmpp.xmlstream import StanzaBase, ElementBase +from slixmpp.xmlstream.xmlstream import InvalidCABundle + +import logging +log = logging.getLogger(__name__) class STARTTLS(StanzaBase): @@ -36,6 +40,12 @@ class Proceed(StanzaBase): namespace = 'urn:ietf:params:xml:ns:xmpp-tls' interfaces: ClassVar[Set[str]] = set() + def exception(self, e: Exception) -> None: + log.exception('Error handling {%s}%s stanza', + self.namespace, self.name) + if isinstance(e, InvalidCABundle): + raise e + class Failure(StanzaBase): """