summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-07 15:03:35 -0800
committerLance Stout <lancestout@gmail.com>2012-03-07 15:03:35 -0800
commit4cb8a8d3895d440893447e758209a56c0cde41b3 (patch)
tree31db030badcecd9b92f84a7e628d55425d5ee213 /sleekxmpp
parenta71823dc040062c02a2036db7473845ca07b52f3 (diff)
downloadslixmpp-4cb8a8d3895d440893447e758209a56c0cde41b3.tar.gz
slixmpp-4cb8a8d3895d440893447e758209a56c0cde41b3.tar.bz2
slixmpp-4cb8a8d3895d440893447e758209a56c0cde41b3.tar.xz
slixmpp-4cb8a8d3895d440893447e758209a56c0cde41b3.zip
Modify the cert event to provide the PEM encoded cert in all cases.
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 03217378..81ba2305 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -468,7 +468,8 @@ class XMLStream(object):
self.socket.connect(self.address)
if self.use_ssl and self.ssl_support:
- cert = self.socket.getpeercert()
+ cert = self.socket.getpeercert(binary_form=True)
+ cert = ssl.DER_cert_to_PEM_cert(cert)
log.debug('CERT: %s', cert)
self.event('ssl_cert', cert, direct=True)
@@ -702,7 +703,8 @@ class XMLStream(object):
self.socket = ssl_socket
self.socket.do_handshake()
- cert = self.socket.getpeercert()
+ cert = self.socket.getpeercert(binary_form=True)
+ cert = ssl.DER_cert_to_PEM_cert(cert)
log.debug('CERT: %s', cert)
self.event('ssl_cert', cert, direct=True)