Commit 4e45ce5b authored by Yann Leboulanger's avatar Yann Leboulanger

store only depth 0 certificate, and don't store fingerprint and pem. Fixes #11

parent b08fdc79
......@@ -90,10 +90,8 @@ class NonBlockingBOSH(NonBlockingTransport):
self.proxy_dict['credentials'] = self.proxy_creds
# ssl variables
self.ssl_fingerprint_sha1 = []
self.ssl_certificate = []
self.ssl_errnum = []
self.ssl_cert_pem = []
self.ssl_certificate = None
self.ssl_errnum = None
def connect(self, conn_5tuple, on_connect, on_connect_failure):
......
......@@ -446,11 +446,9 @@ class NonBlockingTLS(PlugIn):
def _ssl_verify_callback(self, sslconn, cert, errnum, depth, ok):
# Exceptions can't propagate up through this callback, so print them here.
try:
self._owner.ssl_fingerprint_sha1.append(cert.digest('sha1'))
self._owner.ssl_certificate.append(cert)
self._owner.ssl_errnum.append(errnum)
self._owner.ssl_cert_pem.append(OpenSSL.crypto.dump_certificate(
OpenSSL.crypto.FILETYPE_PEM, cert))
if depth == 0:
self._owner.ssl_certificate = cert
self._owner.ssl_errnum = errnum
return True
except:
log.error("Exception caught in _ssl_info_callback:", exc_info=True)
......
......@@ -313,10 +313,8 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
self.on_remote_disconnect = self.disconnect
# ssl variables
self.ssl_fingerprint_sha1 = []
self.ssl_certificate = []
self.ssl_errnum = []
self.ssl_cert_pem = []
self.ssl_certificate = None
self.ssl_errnum = None
# FIXME: transport should not be aware xmpp
def start_disconnect(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment