fix(backend): Type is not assignable

Signed-off-by: Johannes Grumboeck <johannes@grumboeck.net>
This commit is contained in:
Johannes Grumboeck
2022-10-14 00:28:47 +02:00
parent 88ac2dd220
commit 7e739e6009
@@ -107,9 +107,13 @@ async function getGeneratedCertificate(hostname: string, logger?: Logger) {
logger?.warn(`Unable to parse self-signed certificate. ${error}`);
remainingMs = 0
}
if (remainingMs < FIVE_DAYS_IN_MS) {
// Reset certificate if expiration is nearly over
cert = undefined
}
}
if (remainingMs > FIVE_DAYS_IN_MS) {
if (cert) {
logger?.info('Using existing self-signed certificate');
return {
key: cert,