Don't retrieve cert until a connection is made.
This commit is contained in:
parent
6d922d00c3
commit
d807613117
1 changed files with 5 additions and 3 deletions
|
@ -461,14 +461,16 @@ 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)
|
||||
self.socket.connect(self.address)
|
||||
|
||||
if self.use_ssl and self.ssl_support:
|
||||
cert = self.socket.getpeercert()
|
||||
log.debug('CERT: %s', cert)
|
||||
self.event('ssl_cert', cert, direct=True)
|
||||
|
||||
self.set_socket(self.socket, ignore=True)
|
||||
#this event is where you should set your application state
|
||||
self.event("connected", direct=True)
|
||||
|
|
Loading…
Reference in a new issue