mirror of https://github.com/Mikaela/Limnoria.git
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,
|
registerGlobalValue(network, 'ssl', registry.Boolean(ssl,
|
||||||
_("""Determines whether the bot will attempt to connect with SSL
|
_("""Determines whether the bot will attempt to connect with SSL
|
||||||
sockets to %s.""") % name))
|
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('',
|
registerChannelValue(network.channels, 'key', registry.String('',
|
||||||
_("""Determines what key (if any) will be used to join the
|
_("""Determines what key (if any) will be used to join the
|
||||||
channel."""), private=True))
|
channel."""), private=True))
|
||||||
|
|
|
@ -304,7 +304,10 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
||||||
try:
|
try:
|
||||||
if getattr(conf.supybot.networks, self.irc.network).ssl():
|
if getattr(conf.supybot.networks, self.irc.network).ssl():
|
||||||
assert globals().has_key('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]))
|
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