reverseproxy: notify cert change only in cron job
notifying this in ensureCertificate does not work if provider changed in the middle anyway. might as well get them to be in sync in the cronjob. this change also resulted in tls addon getting restarted non-stop if you change from wildcard to non-wildcard since ensureCertificate notifies the change.
This commit is contained in:
@@ -4,7 +4,7 @@ exports = module.exports = {
|
||||
start,
|
||||
stop,
|
||||
|
||||
handleCertChanged,
|
||||
checkCertificate,
|
||||
|
||||
validateConfig,
|
||||
applyConfig
|
||||
@@ -366,14 +366,14 @@ async function stop() {
|
||||
gServer = null;
|
||||
}
|
||||
|
||||
async function handleCertChanged() {
|
||||
async function checkCertificate() {
|
||||
const certificate = await reverseProxy.getDirectoryServerCertificate();
|
||||
if (certificate.cert === gCertificate.cert) {
|
||||
debug('handleCertChanged: certificate has not changed');
|
||||
debug('checkCertificate: certificate has not changed');
|
||||
return;
|
||||
}
|
||||
|
||||
debug('handleCertChanged: certificate changed. restarting');
|
||||
debug('checkCertificate: certificate changed. restarting');
|
||||
await stop();
|
||||
await start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user