summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-02-16 07:02:56 -0800
committerLance Stout <lancestout@gmail.com>2012-02-16 07:02:56 -0800
commitd80761311720263521a115ce4fc5c377e0b296d1 (patch)
tree423031cdee1602f71be6fb0aae3ecc39145f4866 /sleekxmpp
parent6d922d00c38b608c2ae178738882fc00141bb301 (diff)
downloadslixmpp-d80761311720263521a115ce4fc5c377e0b296d1.tar.gz
slixmpp-d80761311720263521a115ce4fc5c377e0b296d1.tar.bz2
slixmpp-d80761311720263521a115ce4fc5c377e0b296d1.tar.xz
slixmpp-d80761311720263521a115ce4fc5c377e0b296d1.zip
Don't retrieve cert until a connection is made.
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 9799c299..d5a7e827 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -461,14 +461,16 @@ class XMLStream(object):
else:
self.socket = ssl_socket
- cert = self.socket.getpeercert()
- log.debug('CERT: %s', cert)
- self.event('ssl_cert', cert, direct=True)
try:
if not self.use_proxy:
log.debug("Connecting to %s:%s", *self.address)
self.socket.connect(self.address)
+ if self.use_ssl and self.ssl_support:
+ cert = self.socket.getpeercert()
+ log.debug('CERT: %s', cert)
+ self.event('ssl_cert', cert, direct=True)
+
self.set_socket(self.socket, ignore=True)
#this event is where you should set your application state
self.event("connected", direct=True)