diff --git a/src/conf.py b/src/conf.py index 112a2b0a4..100743d42 100644 --- a/src/conf.py +++ b/src/conf.py @@ -383,6 +383,9 @@ def registerNetwork(name, password='', ssl=True, sasl_username='', registerGlobalValue(sasl, 'mechanisms', SpaceSeparatedListOfSaslMechanisms( ['ecdsa-nist256p-challenge', 'external', 'plain'], _("""Determines what SASL mechanisms will be tried and in which order."""))) + registerGlobalValue(sasl, 'required', registry.Boolean(False, + _("""Determines whether the bot will abort the connection if the + none of the enabled SASL mechanism succeeded."""))) registerGlobalValue(network, 'socksproxy', registry.String('', _("""If not empty, determines the hostname of the socks proxy that will be used to connect to this network."""))) diff --git a/src/irclib.py b/src/irclib.py index a18990484..078176e14 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -1081,6 +1081,9 @@ class Irc(IrcCommandDispatcher, log.Firewalled): self.sasl_current_mechanism = self.sasl_next_mechanisms.pop(0) self.sendMsg(ircmsgs.IrcMsg(command='AUTHENTICATE', args=(self.sasl_current_mechanism.upper(),))) + elif conf.supybot.networks.get(self.network).sasl.required(): + log.error('None of the configured SASL mechanisms succeeded, ' + 'aborting connection.') else: self.sasl_current_mechanism = None self.endCapabilityNegociation()