mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-23 19:19:53 +00:00
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.
This commit is contained in:
parent
caa967105c
commit
952260b423
1 changed files with 8 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue