mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Add certfp support. Closes GH-468.
This commit is contained in:
parent
2b12a33d82
commit
e65a722b2f
@ -306,6 +306,9 @@ def registerNetwork(name, password='', ssl=False, sasl_username='',
|
||||
registerGlobalValue(network, 'ssl', registry.Boolean(ssl,
|
||||
_("""Determines whether the bot will attempt to connect with SSL
|
||||
sockets to %s.""") % name))
|
||||
registerGlobalValue(network, 'certfile', registry.String('',
|
||||
_("""Determines what certificate file (if any) the bot will use to
|
||||
connect with SSL sockets to %s.""") % name))
|
||||
registerChannelValue(network.channels, 'key', registry.String('',
|
||||
_("""Determines what key (if any) will be used to join the
|
||||
channel."""), private=True))
|
||||
|
@ -304,7 +304,10 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
||||
try:
|
||||
if getattr(conf.supybot.networks, self.irc.network).ssl():
|
||||
assert globals().has_key('ssl')
|
||||
self.conn = ssl.wrap_socket(self.conn)
|
||||
certfile = getattr(conf.supybot.networks, self.irc.network) \
|
||||
.certfile()
|
||||
self.conn = ssl.wrap_socket(self.conn,
|
||||
certfile=certfile or None)
|
||||
self.conn.connect((address, server[1]))
|
||||
def setTimeout():
|
||||
self.conn.settimeout(conf.supybot.drivers.poll())
|
||||
|
Loading…
Reference in New Issue
Block a user