fix(dcrouter): persist proxy certificate validity dates and improve certificate status initialization
This commit is contained in:
@@ -167,8 +167,16 @@ export class CertificateHandler {
|
||||
issuedAt = new Date(certData.created).toISOString();
|
||||
}
|
||||
issuer = 'smartacme-dns-01';
|
||||
} else if (certData?.publicKey) {
|
||||
// certStore has the cert — parse PEM for expiry
|
||||
try {
|
||||
const x509 = new plugins.crypto.X509Certificate(certData.publicKey);
|
||||
expiryDate = new Date(x509.validTo).toISOString();
|
||||
issuedAt = new Date(x509.validFrom).toISOString();
|
||||
} catch { /* PEM parsing failed */ }
|
||||
status = 'valid';
|
||||
issuer = 'cert-store';
|
||||
} else if (certData) {
|
||||
// certStore has the cert (no expiry metadata) — it's loaded and serving
|
||||
status = 'valid';
|
||||
issuer = 'cert-store';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user