summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Ertl <mati@er.tl>2017-05-05 16:51:41 +0200
committerlouiz’ <louiz@louiz.org>2017-05-24 11:31:13 +0200
commit1994ed3025870d3c1ada58dd9d8fcec6e14e88e5 (patch)
tree96c3e69818987fe5f24e4001bc52b5250b5128f8
parentaaa45846d3dd3bd826284200a693e0cbf3efca0d (diff)
downloadslixmpp-1994ed3025870d3c1ada58dd9d8fcec6e14e88e5.tar.gz
slixmpp-1994ed3025870d3c1ada58dd9d8fcec6e14e88e5.tar.bz2
slixmpp-1994ed3025870d3c1ada58dd9d8fcec6e14e88e5.tar.xz
slixmpp-1994ed3025870d3c1ada58dd9d8fcec6e14e88e5.zip
pass SSL context to TLS connections
-rw-r--r--slixmpp/xmlstream/xmlstream.py5
1 files changed, 4 insertions, 1 deletions
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',