Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SASL support #643

Merged
merged 4 commits into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ ircService:
ssl: true
# Whether or not IRC server is using a self-signed cert or not providing CA Chain
sslselfsign: false
# Should the connection attempt to identify via SASL (if a server or user password is given)
# If false, this will use PASS instead. If SASL fails, we do not fallback to PASS.
sasl: false
# Whether to allow expired certs when connecting to the IRC server.
# Usually this should be off. Default: false.
allowExpiredCerts: false
Expand All @@ -73,7 +76,7 @@ ircService:
# -----END CERTIFICATE-----

#
# The connection password to send for all clients as a PASS command. Optional.
# The connection password to send for all clients as a PASS (or SASL, if enabled above) command. Optional.
# password: 'pa$$w0rd'
#
# Whether or not to send connection/error notices to real Matrix users. Default: true.
Expand Down
2 changes: 2 additions & 0 deletions lib/config/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ properties:
type: "boolean"
sslselfsign:
type: "boolean"
sasl:
type: "boolean"
allowExpiredCerts:
type: "boolean"
password:
Expand Down
1 change: 1 addition & 0 deletions lib/irc/ConnectionInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ ConnectionInstance.create = Promise.coroutine(function*(server, opts, onCreatedC
retryCount: 0,
family: server.getIpv6Prefix() || server.getIpv6Only() ? 6 : null,
bustRfc3484: true,
sasl: opts.password ? server.useSasl() : false,
};

if (server.useSsl()) {
Expand Down
4 changes: 4 additions & 0 deletions lib/irc/IrcServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ IrcServer.prototype.useSslSelfSigned = function() {
return Boolean(this.config.sslselfsign);
};

IrcServer.prototype.useSasl = function() {
return Boolean(this.config.sasl);
};

IrcServer.prototype.allowExpiredCerts = function() {
return Boolean(this.config.allowExpiredCerts);
};
Expand Down