summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-02-04 14:16:37 +0100
committerLance Stout <lancestout@gmail.com>2012-02-04 14:16:37 +0100
commit952260b423e628ab9a68ca52d09b6330c7508c62 (patch)
tree2db3b768aea670ed1cc70425d9dcd20ce395b273
parentcaa967105c609537050817021a426b0a7e6d54ec (diff)
downloadslixmpp-952260b423e628ab9a68ca52d09b6330c7508c62.tar.gz
slixmpp-952260b423e628ab9a68ca52d09b6330c7508c62.tar.bz2
slixmpp-952260b423e628ab9a68ca52d09b6330c7508c62.tar.xz
slixmpp-952260b423e628ab9a68ca52d09b6330c7508c62.zip
Add ssl_cert event (direct).
The payload is a dictionary of parsed cert data, as provided by Python's getpeercert() socket method. It unfortunately does not provide much detail beyond basic info.
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 6d27747c..3a2cafc4 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -442,6 +442,9 @@ 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)
@@ -675,6 +678,11 @@ class XMLStream(object):
else:
self.socket = ssl_socket
self.socket.do_handshake()
+
+ cert = self.socket.getpeercert()
+ log.debug('CERT: %s', cert)
+ self.event('ssl_cert', cert, direct=True)
+
self.set_socket(self.socket)
return True
else: