mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 14:59:34 +01:00
Socket: Check if certertificate file exists before using it.
This commit is contained in:
parent
13d2746454
commit
4c24f30504
@ -306,8 +306,11 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
|||||||
assert globals().has_key('ssl')
|
assert globals().has_key('ssl')
|
||||||
certfile = getattr(conf.supybot.networks, self.irc.network) \
|
certfile = getattr(conf.supybot.networks, self.irc.network) \
|
||||||
.certfile()
|
.certfile()
|
||||||
self.conn = ssl.wrap_socket(self.conn,
|
if not certfile or not os.path.isfile(certfile):
|
||||||
certfile=certfile or None)
|
drivers.log.warning('Could not find cert file %s.' %
|
||||||
|
certfile)
|
||||||
|
certfile = None
|
||||||
|
self.conn = ssl.wrap_socket(self.conn, certfile=certfile)
|
||||||
self.conn.connect((address, server[1]))
|
self.conn.connect((address, server[1]))
|
||||||
def setTimeout():
|
def setTimeout():
|
||||||
self.conn.settimeout(conf.supybot.drivers.poll())
|
self.conn.settimeout(conf.supybot.drivers.poll())
|
||||||
|
Loading…
Reference in New Issue
Block a user