File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 Route ,
99} from './services/IpRegistrar.js' ;
1010import {
11- loadCertificateState ,
1211 ensureKeyPair ,
1312 requestCertificate ,
1413 needsRenewal ,
@@ -81,18 +80,12 @@ async function main() {
8180 const publicIp = config . PUBLIC_IP || ( await detectPublicIp ( ) ) ;
8281 console . log ( `\nDetected public IP: ${ publicIp } ` ) ;
8382
84- // Certificate management
83+ // Certificate management - always request fresh cert at startup
84+ // This ensures we get the latest CA and certificate extensions (e.g., nip.io SAN)
8585 console . log ( '\nInitializing certificate...' ) ;
86- certState = loadCertificateState ( ) ;
87-
88- if ( ! certState || needsRenewal ( certState . expiresAt ) ) {
89- const reason = ! certState ? 'no certificate found' : `renewal needed (expires in ${ formatTimeRemaining ( certState . expiresAt ) } )` ;
90- console . log ( `[Cert] Requesting new certificate: ${ reason } ` ) ;
91- const keyPem = await ensureKeyPair ( ) ;
92- certState = await requestCertificate ( provider , keyPem , publicIp ) ;
93- } else {
94- console . log ( `[Cert] Certificate valid, expires in ${ formatTimeRemaining ( certState . expiresAt ) } ` ) ;
95- }
86+ console . log ( '[Cert] Requesting new certificate at startup...' ) ;
87+ const keyPem = await ensureKeyPair ( ) ;
88+ certState = await requestCertificate ( provider , keyPem , publicIp ) ;
9689
9790 // Build route
9891 route = buildRoute (
You can’t perform that action at this time.
0 commit comments