do string compare in certs
This commit is contained in:
@@ -813,7 +813,7 @@ async function restartMailIfActivated() {
|
||||
async function handleCertChanged() {
|
||||
debug('handleCertChanged: will restart if activated');
|
||||
const certificate = await reverseProxy.getMailCertificate();
|
||||
const cert = safe.fs.readFileSync(`${paths.MAIL_CONFIG_DIR}/tls_cert.pem`);
|
||||
const cert = safe.fs.readFileSync(`${paths.MAIL_CONFIG_DIR}/tls_cert.pem`, { encoding: 'utf8' });
|
||||
if (cert === certificate.cert) {
|
||||
debug('handleCertChanged: certificate has not changed');
|
||||
return;
|
||||
@@ -1009,6 +1009,7 @@ async function onDomainAdded(domain) {
|
||||
|
||||
if (!settings.mailFqdn()) return; // mail domain is not set yet (when provisioning)
|
||||
|
||||
debug('onDomainAdded: configuring mail for added domain');
|
||||
await upsertDnsRecords(domain, settings.mailFqdn());
|
||||
await restartMailIfActivated();
|
||||
}
|
||||
@@ -1016,6 +1017,7 @@ async function onDomainAdded(domain) {
|
||||
async function onDomainRemoved(domain) {
|
||||
assert.strictEqual(typeof domain, 'string');
|
||||
|
||||
debug('onDomainRemoved: configuring mail for removed domain');
|
||||
await restartMail();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user