Do not generate and send client certificate unless SASL EXTERNAL is requested

Fixes #4092
This commit is contained in:
Pavel Djundik 2020-10-30 22:56:05 +02:00
parent 69986b3ee5
commit a76e75f609

View File

@ -204,8 +204,7 @@ Network.prototype.setIrcFrameworkOptions = function (client) {
this.irc.options.tls = this.tls; this.irc.options.tls = this.tls;
this.irc.options.rejectUnauthorized = this.rejectUnauthorized; this.irc.options.rejectUnauthorized = this.rejectUnauthorized;
this.irc.options.webirc = this.createWebIrc(client); this.irc.options.webirc = this.createWebIrc(client);
this.irc.options.client_certificate = null;
this.irc.options.client_certificate = this.tls ? ClientCertificate.get(this.uuid) : null;
if (!this.sasl) { if (!this.sasl) {
delete this.irc.options.sasl_mechanism; delete this.irc.options.sasl_mechanism;
@ -213,6 +212,7 @@ Network.prototype.setIrcFrameworkOptions = function (client) {
} else if (this.sasl === "external") { } else if (this.sasl === "external") {
this.irc.options.sasl_mechanism = "EXTERNAL"; this.irc.options.sasl_mechanism = "EXTERNAL";
this.irc.options.account = {}; this.irc.options.account = {};
this.irc.options.client_certificate = ClientCertificate.get(this.uuid);
} else if (this.sasl === "plain") { } else if (this.sasl === "plain") {
delete this.irc.options.sasl_mechanism; delete this.irc.options.sasl_mechanism;
this.irc.options.account = { this.irc.options.account = {