From 1994ed3025870d3c1ada58dd9d8fcec6e14e88e5 Mon Sep 17 00:00:00 2001 From: Mathias Ertl Date: Fri, 5 May 2017 16:51:41 +0200 Subject: pass SSL context to TLS connections --- slixmpp/xmlstream/xmlstream.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 4ff9fc58..0f77ae33 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -298,12 +298,15 @@ class XMLStream(asyncio.BaseProtocol): # and try (host, port) as a last resort self.dns_answers = None + if self.use_ssl: + ssl_context = self.get_ssl_context() + yield from asyncio.sleep(self.connect_loop_wait) try: yield from self.loop.create_connection(lambda: self, self.address[0], self.address[1], - ssl=self.use_ssl, + ssl=ssl_context, server_hostname=self.default_domain if self.use_ssl else None) except Socket.gaierror as e: self.event('connection_failed', -- cgit v1.2.3