diff --git a/slixmpp/componentxmpp.py b/slixmpp/componentxmpp.py index bde112b4..f811987d 100644 --- a/slixmpp/componentxmpp.py +++ b/slixmpp/componentxmpp.py @@ -95,7 +95,9 @@ class ComponentXMPP(BaseXMPP): for st in Message, Iq, Presence: register_stanza_plugin(st, Error) - def connect(self, host: str = None, port: int = 0, use_ssl: Optional[bool] = None) -> None: + def connect(self, host: Optional[str] = None, port: int = 0, use_ssl: Optional[bool] = None, + force_starttls: Optional[bool] = None, + disable_starttls: Optional[bool] = None) -> None: """Connect to the server. @@ -105,6 +107,8 @@ class ComponentXMPP(BaseXMPP): Defauts to :attr:`server_port`. :param use_ssl: Flag indicating if SSL should be used by connecting directly to a port using SSL. + :param force_starttls: UNUSED + :param disable_starttls: UNUSED """ if host is not None: self.server_host = host diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 7df8d420..95e6b9a3 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -524,7 +524,7 @@ class XMLStream(asyncio.BaseProtocol): else: self.loop.run_until_complete(self.disconnected) else: - tasks: List[Awaitable] = [asyncio.Task(asyncio.sleep(timeout))] + tasks: List[asyncio.Task] = [asyncio.Task(asyncio.sleep(timeout))] if not forever: tasks.append(self.disconnected) self.loop.run_until_complete(asyncio.wait(tasks)) @@ -850,6 +850,8 @@ class XMLStream(asyncio.BaseProtocol): log.debug("Connection error:", exc_info=True) self.disconnect() return False + if transp is None: + raise Exception("Transport should not be none") der_cert = transp.get_extra_info("ssl_object").getpeercert(True) pem_cert = ssl.DER_cert_to_PEM_cert(der_cert) self.event('ssl_cert', pem_cert)