mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +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:
|
else:
|
||||||
self.socket = ssl_socket
|
self.socket = ssl_socket
|
||||||
|
|
||||||
|
cert = self.socket.getpeercert()
|
||||||
|
log.debug('CERT: %s', cert)
|
||||||
|
self.event('ssl_cert', cert, direct=True)
|
||||||
try:
|
try:
|
||||||
if not self.use_proxy:
|
if not self.use_proxy:
|
||||||
log.debug("Connecting to %s:%s", *self.address)
|
log.debug("Connecting to %s:%s", *self.address)
|
||||||
|
@ -675,6 +678,11 @@ class XMLStream(object):
|
||||||
else:
|
else:
|
||||||
self.socket = ssl_socket
|
self.socket = ssl_socket
|
||||||
self.socket.do_handshake()
|
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)
|
self.set_socket(self.socket)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue